Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2 - Mailing list pgsql-general

From karthik kumar
Subject Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2
Date
Msg-id CADbTQ2a9Y4-3dQCOq7BG8juf2cyZvm7tAhW_XTpdJv1n5c-QPA@mail.gmail.com
Whole thread Raw
Responses Re: Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Hi Guru's,

I am trying to access few table present in DB2 LUW from postgres database.
All commands work fine, however when I try to select data from table it throws error:

pg@a92a3741d40e:~/odbc_fdw$ psql -d postgres
psql (10.1)
Type "help" for help.

postgres=# create extension odbc_fdw;
CREATE EXTENSION

postgres=# CREATE SERVER odbc_db2 FOREIGN DATA WRAPPER odbc_fdw OPTIONS (dsn 'SAMPLE');
CREATE SERVER



postgres=# CREATE USER MAPPING FOR pg SERVER odbc_db2 OPTIONS (odbc_UID  'db2inst1', odbc_PWD 'db2inst1');
CREATE USER MAPPING

postgres=#
postgres=# CREATE FOREIGN TABLE
postgres-#   odbc_testt (
postgres(#     id integer
postgres(#   )
postgres-#   SERVER odbc_db2
postgres-#   OPTIONS (
postgres(#     odbc_database 'SAMPLE',
postgres(#     odbc_schema 'db2inst1',
postgres(#     sql_query 'select x from `db2inst1`.`TESTT`',
postgres(#     sql_count 'select count(id) from `db2inst1`.`dblist`'
postgres(#   );
CREATE FOREIGN TABLE

postgres=# select * from odbc_testt;
ERROR:  Connecting to driver



pg@a92a3741d40e:~/odbc_fdw$ isql -v SAMPLE db2inst1 db2inst1
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select * from testt;
+------------+
| X          |
+------------+
| 1          |
+------------+
SQLRowCount returns -1
1 rows fetched
SQL> quit


root@a92a3741d40e:/home/pg# cat /etc/odbc.ini
[SAMPLE]
Description = DB2 remote SAMPLE Database
Driver=/home/db2inst1/sqllib/lib64/libdb2.so
SERVERNAME=MYDB2
UID=db2inst1
PWD=db2inst1
port=50000


Thanks,
Karthik.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Conflict between JSON_AGG and COPY
Next
From: Adrian Klaver
Date:
Subject: Re: Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2