Menu
Amazon Redshift
Management Guide (API Version 2012-12-01)

ODBC Driver Configuration Options

You can use the configuration options described in the following table to control the behavior of the Amazon Redshift ODBC driver.

In Windows, you typically set driver options when you configure a DSN. You can also set driver options in the connection string when you connect programatically, or by adding or changing registry keys in HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\your_DSN. For more information about configuring a DSN, see Install and Configure the Amazon Redshift ODBC Driver on Microsoft Windows Operating Systems. For an example of setting driver options in a connection string, see Connect to Your Cluster Programmatically.

In Linux and Mac OS X, you set driver configuration options in your odbc.ini and amazon.redshiftodbc.ini files, as described in Configure the ODBC Driver on Linux and Mac OS X Operating Systems. Configuration options set in an amazon.redshiftodbc.ini file apply to all connections, whereas configuration options set in an odbc.ini file are specific to a connection. Configuration options set in odbc.ini take precedence over configuration options set in amazon.redshiftodbc.ini.

ODBC Option Matching PostgreSQL option exists? Default Value Description
BoolsAsChar Yes 0

When this option is enabled (1), the driver exposes Boolean values as data type SQL_VARCHAR with a length of 5.

When this option is disabled (0), the driver exposes Boolean values as data type SQL_BIT.

Database Yes The name of the database to use when the connection is established.
Driver Yes The location of the Amazon Redshift ODBC driver shared object file.
Fetch Yes 100 The number of rows that the driver returns when UseDeclareFetch is enabled.
KeepAlive No. If keepalives are disabled at the TCP/IP level, KeepAliveTime and KeepAliveInterval are set to 0. 1

When this option is enabled (1), the driver uses TCP keepalives to prevent connections from timing out.

When this option is disabled (0), the driver does not use TCP keepalives.

KeepAliveCount No 0

The number of TCP keepalive packets that can be lost before the connection is considered broken.

When this option is set to 0, the driver uses the TCP/IP system default for this setting.

KeepAliveTime Yes 0

The number of seconds of inactivity before the driver sends a TCP keepalives packet.

When this option is set to 0, the driver uses the TCP/IP system default for this setting.

KeepAliveInterval Yes 0

The number of seconds between each TCP keepalive retransmission.

Locale No en-US The locale to use for error messages.
MaxBytea Yes 255 The maximum data length for BYTEA columns, in bytes.
MaxLongVarChar Yes 8190 The maximum data length for LONG VARCHAR columns, in UTF-8 code units.
MaxVarchar Yes 255 The maximum data length for VARCHAR columns, in UTF-8 code units.
Port Yes

The port to connect to on the Amazon Redshift server.

Note

By default, Amazon Redshift uses port 5439.

PWD or Password Yes The password to use to connect to the Amazon Redshift server.
Server or Servername Yes The IP address or hostname of the Amazon Redshift server.
SingleRowMode No 0

When this option is enabled (1), the driver returns query results one row at a time. Enable this option if you plan to query large results and don't want to retrieve the entire result into memory.

When this option and UseDeclareFetch are both disabled (0), the driver retrieves the entire query result into memory.

Note

If UseDeclareFetch is enabled (1), then it takes precedence over SingleRowMode. If SingleRowMode is enabled (1) and UseDeclareFetch is disabled (0), then SingleRowMode takes precedence over UseMultipleStatements.

SSLCertPath Yes The default file name is root.crt and the default path is the location of the driver DLL file. The full path of the file containing the root certificate for verifying the server. If this option is not set, then the driver looks in the folder that contains the driver DLL file.
SSLMode Yes require The SSL certificate verification mode to use when connecting. For more information about possible SSL modes to use, see Using SSL and Server Certificates in ODBC.
TextAsLongVarchar Yes 0

When this option is enabled (1), the driver returns TEXT columns as LONG VARCHAR data.

When this option is disabled (0), the driver returns TEXT columns as TEXT data.

UID Yes The user name to use to connect to the Amazon Redshift server.
UseDeclareFetch Yes 0

When this option is enabled (1), the driver returns a specific number of rows at a time. To set the number of rows, use the Fetch option.

When this option is disabled (0) and SingleRowMode is enabled (1), the driver returns query results one row at a time. If SingleRowMode is also disabled (0), then the driver retrieves the entire query result into memory.

Note

If UseDeclareFetch is enabled, then UseDeclareFetch takes precedence over SingleRowMode and UseMultipleStatements.

UseMultipleStatements No 0

When this option is enabled (1), the driver can run queries that are split into separate statements.

When this option is disabled (0), the driver runs queries as single statements.

Note

If UseDeclareFetch is enabled (1), then UseDeclareFetch takes precedence over UseMultipleStatements. If UseDeclareFetch is disabled (0) but SingleRowMode is enabled (1), then SingleRowMode takes precedence over UseMultipleStatements.

Username Yes The same information as UID (the user name to use to connect to the Amazon Redshift server). If UID is defined, then UID takes precedence over Username.
UseUnicode No 0

When this option is enabled (1), the driver returns data as Unicode character types:

  • CHAR is returned as SQL_WCHAR.

  • VARCHAR is returned as SQL_WVARCHAR.

  • TEXT is returned as SQL_WLONGVARCHAR.

When this option is disabled (0), the driver returns data as regular SQL types:

  • CHAR is returned as SQL_CHAR.

  • VARCHAR is returned as SQL_VARCHAR.

  • TEXT is returned as SQL_LONGVARCHAR.