Skip to main content

PostgreSQL DotNet DataType Mapping

Here’s a list of .NET datatypes, and how best to store each one.

.NET Datatype

PostGreSQL DataType

datetime (UTC)

timestamp without time zone

Guid

uuid

float

real

double

double precision

bool

boolean

decimal

numeric

string (unlimited size)

text COLLATE pg_catalog."default"

string (limited but unfixed)

character varying(50) COLLATE pg_catalog."default"

int32

integer

int64

bigint

DMClassName (string)

character varying(50) COLLATE pg_catalog."default"

DMClassVer (int)

integer NOT NULL

Id (Guid)

uuid NOT NULL

Id (int)

integer NOT NULL

Phone Number (string)

character varying(20) COLLATE pg_catalog."default"

Company (string)

character varying(100) COLLATE pg_catalog."default"

IconName (string)

character varying(50) COLLATE pg_catalog."default"