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 OptionMatching PostgreSQL option exists?Default ValueDescription
BoolsAsCharYes0

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.

DatabaseYes The name of the database to use when the connection is established.
DriverYes The location of the Amazon Redshift ODBC driver shared object file.
FetchYes100The number of rows that the driver returns when UseDeclareFetch is enabled.
KeepAliveNo. 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.

KeepAliveCountNo0

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.

KeepAliveTimeYes0

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.

KeepAliveIntervalYes0

The number of seconds between each TCP keepalive retransmission.

LocaleNoen-USThe locale to use for error messages.
MaxByteaYes255The maximum data length for BYTEA columns, in bytes.
MaxLongVarCharYes8190The maximum data length for LONG VARCHAR columns, in UTF-8 code units.
MaxVarcharYes255The maximum data length for VARCHAR columns, in UTF-8 code units.
PortYes 

The port to connect to on the Amazon Redshift server.

Note

By default, Amazon Redshift uses port 5439.

PWD or PasswordYes The password to use to connect to the Amazon Redshift server.
Server or ServernameYes The IP address or hostname of the Amazon Redshift server.
SingleRowModeNo0

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.

SSLCertPathYesThe 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.
SSLModeYesrequireThe 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.
TextAsLongVarcharYes0

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.

UIDYes The user name to use to connect to the Amazon Redshift server.
UseDeclareFetchYes0

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.

UseMultipleStatementsNo0

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.

UsernameYes 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.
UseUnicodeNo0

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.