PostgreSQL and C# Datatypes PostgreSQL and C# Datatypes postgresql postgresql

PostgreSQL and C# Datatypes


Maybe you can find something looking through the documentation of Npgsql, which is an implementation of a .NET Data Provider for PostgreSQL.

This page of the documentation actually contains a complete table of what you are looking for. Search for "4. Current Npgsql Status" - "Supported data types". There is a nice table with all PostgreSQL data types and their correspondents in .NET.

Postgresql  NpgsqlDbType System.DbType Enum .Net System Type----------  ------------ ------------------ ----------------int8        Bigint       Int64              Int64bool        Boolean      Boolean            Booleanbytea       Bytea        Binary             Byte[]date        Date         Date               DateTimefloat8      Double       Double             Doubleint4        Integer      Int32              Int32money       Money        Decimal            Decimalnumeric     Numeric      Decimal            Decimalfloat4      Real         Single             Singleint2        Smallint     Int16              Int16text        Text         String             Stringtime        Time         Time               DateTimetimetz      Time         Time               DateTimetimestamp   Timestamp    DateTime           DateTimetimestamptz TimestampTZ  DateTime           DateTimeinterval    Interval     Object             TimeSpanvarchar     Varchar      String             Stringinet        Inet         Object             IPAddressbit         Bit          Boolean            Booleanuuid        Uuid         Guid               Guidarray       Array        Object             Array