This is a quick guide to show how the PostgreSQL types are mapped into dbExpress™ types by the pgExpress Driver:
Table 2.1.
PostgreSQL | pgExpress | Obs |
---|---|---|
int2 | TSmallIntField | |
int4 | TIntegerField | int8 |
int8 | TLargeIntField | The dbExpress™ technology does not have have native support for 64
bit integers; however, by using a hack, we provide native Int8 support. Please
note the TIndexDef issues associated
with native Int8 usage in the link here. |
char | TStringField | Fixed length. |
varchar | TStringField |
If you want/need large values, try using the TEXT field type which maps into a BLOB/Memo ( varchar fields with no size specifier is identical to a text field and will be mapped in pgExpress just as a text field. |
text | TBLOBField/Memo | Check our FAQ for more info on this. Text fields mapped as Memo will be faster and more efficient in terms of memory. You can also map them as strings (padded at 32Kb due to dbExpress™ limitation); check here. |
numeric | TFMTBCDField | VCL/CLX TFMTBCDFields support up to 32 digits. If you have a field with more then that, it will get mapped as TStringField.Note: TFMTBCDField is used instead of TBCDField because it allows greater precision. |
time | TTimeField | See note below. The time field type support fractions. |
timetz | TTimeField | Timezones and second fractions aren't supported by VCL/CLX and they can give your trouble when used in a WHERE clause on INSERT/UPDATE/DELETE queries. Please refer to our FAQ for more info. |
date | TDateField | |
timestamp | TTimeStampField | See note from fractions on the timetz field. |
timestamptz | TSQLTimeStampField | See notes from timezones and fractions on the timetz field. |
bool | TBooleanField | |
name | TStringField | Fixed length; name is a field type used internally by PostgreSQL. |
bpchar | TStringField | Fixed length. |
_bpchar | TStringField | Fixed length. |
oid | TIntegerField | Integer |
float4 | TFloatField | Actually TFloatField can support more precision and scale then float4 fields and are recommended. You can teorically have a overflow or underflow if someone tries to insert a bad value. |
float8 | TFloatField | |
abstime/reltime | TTimeField | See note for time fields. |
interval/tinterval | TTimeStampField | See note for time fields. |
bytea | TVarBytesField | Reads up to 32kb (dbExpress™ limitation). |
money | TCurrencyField | The money field is obsolete. The PostgreSQL documentation advices to use numeric or float8 fields instead. |
lo | TBlobField/Binary | Following the PostgreSQL ODBC driver convention, the 'lo' field represents Large Objects. |
Other | TStringField | Unknown fields are mapped by default as Strings. You can turn this off (and thus don't use the fields at all) turning the MapUnknownAsString special param. |