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
xmlTMemoField
bytea, oidTBlobField
cid, xid, tidTIntegerField
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
UUIDTGUIDField
pointTPSQLPointField
circleTPSQLCircleField
boxTPSQLBoxField
lsegTPSQLLSegField
arrays typesTStringField
composite and user defined typesTStringField
UNKNOWNTStringField with length 64
If Delphi 2009 (or higher) is used and TPSQLDatabase.CharSet is set to 'UTF8' then TStringField will be changed to TWideStringField, TMemoField to TWideMemoField.
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.