Configuring ODBC access to PostgreSQL data sources
To configure the federated server to access PostgreSQL data sources, you must provide the federated server with information about the data sources and objects that you want to access. The ODBC wrapper is optimized to access PostgreSQL data sources. The ODBC wrapper detects the ODBC driver and automatically configures the performance options.
Before you begin
The PostgreSQL ODBC driver must be configured on your federated server.
For prerequisites that apply to all ODBC data sources, see Configuring access to ODBC data sources.
Restrictions
- nnstat method 1 is not supported for PostgreSQL. There is no error when using method 1, but no data will be returned.
- Transparent DDL is not supported for PostgreSQL.
- IUD is not supported for PostgreSQL.
Additional restrictions apply to all ODBC data sources. See Configuring access to ODBC data sources.
Procedure
CREATE SERVER statement - Example for PostgreSQL
The following example shows you how to register a server definition for PostgreSQL by using the CREATE SERVER statement:
CREATE SERVER psqlserver
TYPE postgresql VERSION 9.2 OPTIONS (
HOST 'pgsqldev.ibm.com', PORT '5432', DBNAME 'CLNTS390')
- The name (required) that you assign to the PostgreSQL database server (in this case, "psqlserver") must be unique.
- The TYPE clause specifies the type of data source server to which you are configuring access.
- HOST (required) specifies the fully qualified domain name, host name alias, or IP address of the host for the PostgreSQL database that you want to access.
- PORT specifies the port on which the PostgreSQL database that you want to access is listening.
- DBNAME specifies an alias for the database that you want to access.