The following table describes the key connection string parameters for connecting to PostgreSQL via the ODBC driver.
| Parameter | Description |
|---|---|
Server |
The host name or IP address of the PostgreSQL server. |
Port |
The port number for the connection. The default value is 5432. |
User ID |
The PostgreSQL username. |
Password |
The PostgreSQL password. |
Database |
The name of the database to connect to. |
Schema |
The name of the schema to use. |
| Parameter | Description |
|---|---|
Allow NULL strings |
Allows NULL values to be passed to metadata retrieval functions, ensuring compatibility with third-party tools that send NULL where the ODBC specification requires a value. The default value is True. |
Charset |
Specifies the character set for the driver to use when reading and writing character data. |
Connection Timeout |
Specifies the time (in seconds) to wait for a connection to open before terminating an attempt. The default value is 15. |
Empty strings as NULL |
Treats empty strings as NULL values when passed to metadata retrieval functions, ensuring compatibility with third-party tools that pass empty strings instead of NULL. The default value is False. |
EnablePgGIS |
Enables support for the PostGIS extension in PostgreSQL. The default value is False. |
IP Version |
Specifies the Internet Protocol version to use for the connection. Available values:
|
MinFetchRows |
Controls the minimum number of rows the driver fetches from the server during query execution.
SQL_ATTR_ROW_ARRAY_SIZE, set MinFetchRows to 0.Note: The default value of SQL_ATTR_ROW_ARRAY_SIZE is 1, which may significantly reduce performance if MinFetchRows is set to 0. |
Multiple Connections |
Enables the driver to open parallel connections to the database. The default value is False. |
ODBC Behavior |
Specifies the ODBC specification version the driver must conform to, based on the expectations of a third-party tool. Typically, the driver’s behavior is controlled by setting the SQL_ATTR_ODBC_VERSION attribute via the SQLSetEnvAttr function. However, some third-party tools expect the driver to behave according to ODBC 2.x standards, but either fail to set this attribute or pass an incorrect value.In such cases, you can explicitly define the required behavior in the connection string using the ODBC Behavior parameter. Available values:
|
Protocol |
Specifies the PostgreSQL protocol version to use for communication with the server. |
Read Only |
Specifies whether to prevent data from being modified. The default value is False. |
RegionalDateTimeSettings |
Enables local regional settings for converting dates and times to strings. The default value is False. |
RegionalNumberSettings |
Enables local regional settings for converting numbers to strings. The default value is False. |
String Types |
Specifies the type of string data returned:
|
UseUnicode |
Enables Unicode (UTF-8) support for string data. The default value is False. |
Uuid With Braces |
Specifies whether to display UUIDs (Universally Unique Identifiers) in curly braces. The default value is True. |
DRIVER={Devart ODBC Driver for PostgreSQL};Server=myServer;User ID=myUsername;Password=myPassword;Database=myDatabase;Schema=mySchema