This section shows how various PostgreSQL datatypes are mapped to Borland's TField descendants.
PostgreSQL datatypes
|
TField descedant
|
bigint (int8), bigserial
|
TLargeintField
|
smallint (int2)
|
TSmallIntField
|
integer (int4)
|
TIntegerField
|
serial
|
TAutoIncField
|
real, double precision
|
TFloatField
|
decimal, numeric
|
TFmtBcdField
|
money (deprecated)
|
TStringField
|
character varying(<8192) (varchar)
|
TStringField
|
character varying(>=8192) (varchar)
|
TMemoField
|
character(n) (char)
|
TStringField
|
text
|
TMemoField
|
xml
|
TMemoField
|
bytea, oid
|
TBlobField
|
cid, xid, tid
|
TIntegerField
|
boolean
|
TBooleanField
|
timestamp [ (p) ] [ without time zone ]
|
TDateTimeField
|
timestamp [ (p) ] with time zone
|
TStringField
|
time [ (p) ] [ without time zone ]
|
TTimeField
|
time [ (p) ] with time zone
|
TStringField
|
date
|
TDateField
|
interval [ (p) ]
|
TStringField
|
point, line, lseg, box, polygon (closed path), path, circle
|
TStringField
|
cidr, inet, macaddr
|
TStringField
|
bit(n), bit varying(n)
|
TStringField
|
UUID
|
TGUIDField
|
point
|
TPSQLPointField
|
circle
|
TPSQLCircleField
|
box
|
TPSQLBoxField
|
lseg
|
TPSQLLSegField
|
arrays types
|
TStringField
|
composite and user defined types
|
TStringField
|
UNKNOWN
|
TStringField 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.