Accessing DB2 tables from postgresql

From: Swapnil Vaze <swapvaze28(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Accessing DB2 tables from postgresql
Date: 2017-06-27 10:11:39
Message-ID: CABWf+yQhFNPuTHdB0t3L9D+FWaU5UvNTvYT2hbZFo8r2SVf1cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I am trying to access few table present in DB2 LUW from postgres9.5
database.

I have installed unixODBC driver and connection to DB2 is working fine.
I have installed CartoDB/odbc_fdw foreign data wrappers.
I have user below commands to create foreign table:
$ create extension odbc_fdw;
$ CREATE USER MAPPING FOR postgres SERVER odbc_server_db2 options(odbc_UID
'<username>', odbc_PWD '<password>');
$ CREATE FOREIGN TABLE odbc_table (CTGRY_ID INTEGER, CTGRY_CD
VARCHAR(10),UPDT_TS TIMESTAMP) SERVER odbc_server_db2 OPTIONS (database
'TESTV9', schema 'schema1', table 'table1' );

All commands work fine, however when I try to select data from table it
throws error:
$ select * from odbc_table;
ERROR: Executing ODBC query

Can anyone help me here?
How can I access DB2 LUW or zOS database tables from postgres?

--
Thanks & Regards,
Swapnil Vaze

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rajan 2017-06-27 11:09:53 Unable to understand index only scan as it is not happening for one table while it happens for other
Previous Message Alexander Farber 2017-06-27 08:16:25 Re: ERROR: query returned no rows