5.2.7.PostgreSQL
OpenLink Lite Drivers for Unix can be configured in 3 ways:
| Web Based Wizard |
| Web Based Forms |
| Manually |
Once you have configured the generic parts of the data source using one of the above listed methods, you will need to define the driver environment. Below are the common options with their descriptions for the environment section:
[Environment PostgreSQL]
CURSOR_SENSITIVITY = LOW ; Set to HIGH after loading oplrvc.sql
;ODBC_CATALOGS = Y ; Uncomment after loading odbccat defs
The following options can be used in the ConnectOptions or Options field of the client configuration:
-
-H <hostname>. Connect to postmaster on <hostname>. This defaults to localhost if unspecified
-
-P <port>. Contact postmaster on port <port>, which defaults to PGPORT (5432) is unspecified.
-
-T. Disable ODBC transaction management. All transactions will be automatically committed. This prevents palloc() failures with out-of-memory errors when doing really big transactions such as Exporting 10000 records from MS/Access.
Datatype Mapping from ODBC Datatypes to Postgres Datatypes
This information can be queried by the SQLTypeInfo catalog call.
Table5.2.Default Rule Book settings
| SQL type | Postgres type |
|---|---|
| SQL_CHAR | char |
| SQL_VARCHAR | varchar |
| SQL_LONGVARCHAR | text |
| SQL_DECIMAL | varchar |
| SQL_NUMERIC | varchar |
| SQL_BIT | bit |
| SQL_TINYINT | int2 |
| SQL_SMALLINT | int2 |
| SQL_INTEGER | int4 |
| SQL_BIGINT | varchar |
| SQL_REAL | float4 |
| SQL_DOUBLE | float8 |
| SQL_FLOAT | float8 |
| SQL_BINARY | not supported |
| SQL_VARBINARY | not supported |
| SQL_LONGVARBINARY | not supported |
| SQL_DATE | not supported |
| SQL_TIME | not supported |
| SQL_TIMESTAMP | not supported |
Datatype Mapping from Postgres Datatypes to ODBC Datatypes
This information can be queried by the SQLColumns catalog call.
Table5.3.Default Rule Book settings
| Postgres type | SQL type | Precision |
|---|---|---|
| bool | SQL_CHAR | 1 |
| char | SQL_CHAR | 1 |
| name | SQL_VARCHAR | 32 |
| char16 | SQL_CHAR | 16 |
| int2 | SQL_SMALLINT | |
| int4 | SQL_INTEGER | |
| regproc | SQL_VARCHAR | 16 |
| text | SQL_LONGVARCHAR | 8000 |
| oid | SQL_INTEGER | (*) |
| tid | SQL_VARCHAR | 19 |
| xid | SQL_VARCHAR | 12 |
| cid | SQL_VARCHAR | 3 |
| oid8 | SQL_VARCHAR | 89 |
| smgr | SQL_VARCHAR | 12 |
| char2 | SQL_VARCHAR | 2 |
| char4 | SQL_VARCHAR | 4 |
| char8 | SQL_VARCHAR | 8 |
| filename | SQL_VARCHAR | 255 |
| float4 | SQL_REAL | |
| float8 | SQL_DOUBLE | |
| abstime | SQL_VARCHAR | 60 |
| reltime | SQL_VARCHAR | 60 |
| tinterval | SQL_VARCHAR | 60 |
| unknown | SQL_VARCHAR | 255 |
| bpchar | SQL_CHAR | 255 |
| varchar | SQL_VARCHAR | 255 |
| date | SQL_CHAR | 10 |
| time | SQL_CHAR | 16 |
| other type | SQL_LONGVARCHAR | 8000 |
(*) Note: An oid is returned as a SQL_INTEGER, because otherwise it would not be useable for SQLSpecialColumns.
Binary data / large objects are not supported in this release.