PostgresDAC

DataTypes map

Previous Next

This section shows how various PostgreSQL datatypes are mapped to Borland's TField descendants.

PostgreSQL datatypesTField descedant
bigint (int8), bigserialTLargeintField
smallint (int2)TSmallIntField
integer (int4)TIntegerField
serialTAutoIncField
decimal, numeric, real, double precisionTFloatField
money (deprecated)TStringField
character varying(<8192) (varchar)TStringField
character varying(>=8192) (varchar)TMemoField
character(n) (char)TStringField
textTMemoField
bytea, oidTBlobField
booleanTBooleanField
timestamp [ (p) ] [ without time zone ]TDateTimeField
timestamp [ (p) ] with time zoneTStringField
time [ (p) ] [ without time zone ]TTimeField
time [ (p) ] with time zoneTStringField
dateTDateField
interval [ (p) ]TStringField
point, line, lseg, box, polygon (closed path), path, circleTStringField
cidr, inet, macaddrTStringField
bit(n), bit varying(n)TStringField
arrays typesTStringField
composite and user defined typesTStringField
Be careful while working with Unicode encodings fields (e.g., utf8). Their lengths are evaluated in symbols, not in bytes: data lost may happen.
Delphi 7 and prior has poor support for int64 values in variant type. This means that you'll be unable to use Locate() and similar methods with such fields. Lookup fields will not work proper too due to their dependence on Locate() method. Please update your IDE to BDS 2006 or don't use bigint (int8) and bigserial datatypes for keys and indexes if you need to use them in lookup fields.