pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steven Hirsch <snhirsch@gmail.com>
To: karthik kumar <karthikkumar.db2dba@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Fwd: Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2
Date: Wed, 11 Apr 2018 14:33:01 -0400 (EDT)
Message-ID: <alpine.DEB.2.20.1804111430240.4018@z87> (raw)
In-Reply-To: <CADbTQ2bypc9LwyVQ4hN0ykO0PGsEbaMeyVnB4eYyH-huOxXHNA@mail.gmail.com>
References: <CADbTQ2a9Y4-3dQCOq7BG8juf2cyZvm7tAhW_XTpdJv1n5c-QPA@mail.gmail.com>
	<2aef0ab7-8854-978a-aae0-7e3cf6214c79@aklaver.com>
	<CADbTQ2aKKrbGYH9p32+hx+=SYrXY_Q84JhfOqUzuRWaOZ260Gw@mail.gmail.com>
	<a175dc17-9737-58c8-5819-f99a6c43a47c@aklaver.com>
	<CADbTQ2bYPqKaxFu78MNSufYSRSAkEksBifRJ_iCUnjRCBT9jVA@mail.gmail.com>
	<2f510eb0-86d7-b2fa-1397-5d16512c1234@aklaver.com>
	<CADbTQ2ZZ0POqB4ZMzV2UV5ikDNoB=Jo3V27fzQeQyNGwxd7cvw@mail.gmail.com>
	<CADbTQ2bypc9LwyVQ4hN0ykO0PGsEbaMeyVnB4eYyH-huOxXHNA@mail.gmail.com>

On Wed, 11 Apr 2018, karthik kumar wrote:

> Hello Adrian
> 
> I built fdw with debug option and ran it with debug option.  Here is the output
> 
> postgres=# select * from odbc_testt;
> DEBUG:  StartTransactionCommand
> DEBUG:  StartTransaction
> DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
> DEBUG:  odbcGetForeignRelSize
> DEBUG:  odbcGetTableOptions
> DEBUG:  odbcGetOptions
> DEBUG:  extract_odbcFdwOptions
> DEBUG:  CONN STR: database=SAMPLE;DRIVER=SAMPLE;UID=db2inst1;PWD=db2inst1
> DEBUG:  Error result (-1): Connecting to driver
> ERROR:  Connecting to driver
> 
> Looking at the code this is the place where the error is coming from:
> 
> /* Allocate a connection handle */
>     SQLAllocHandle(SQL_HANDLE_DBC, *env, dbc);
>     /* Connect to the DSN */
>     ret = SQLDriverConnect(*dbc, NULL, (SQLCHAR *) conn_str.data, SQL_NTS,
>                            OutConnStr, 1024, &OutConnStrLen, SQL_DRIVER_COMPLETE);
>     check_return(ret, "Connecting to driver", dbc, SQL_HANDLE_DBC);
> }
> 
> Trouble is, I can't get any unixodbc manual to indicate the meaning of -1.

Doesn't the DB2 driver have a debug/trace option you can turn on with an 
environment variable?  That may tell you more.

I'd also suggest you try connecting to the database from the same host 
using the db2clp.  That gets the FDW out of the picture and may give 
better diagnostics.


-- 

view thread (17+ messages)  latest in thread

Message-ID: <alpine.DEB.2.20.1804111430240.4018@z87>
Permalink:  ../alpine.DEB.2.20.1804111430240.4018@z87/
Also on:    postgresql.org/message-id/alpine.DEB.2.20.1804111430240.4018@z87

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: snhirsch@gmail.com, karthikkumar.db2dba@gmail.com, adrian.klaver@aklaver.com
  Subject: Re: Fwd: Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2
  In-Reply-To: <alpine.DEB.2.20.1804111430240.4018@z87>
  References: <CADbTQ2a9Y4-3dQCOq7BG8juf2cyZvm7tAhW_XTpdJv1n5c-QPA@mail.gmail.com> <2aef0ab7-8854-978a-aae0-7e3cf6214c79@aklaver.com> <CADbTQ2aKKrbGYH9p32+hx+=SYrXY_Q84JhfOqUzuRWaOZ260Gw@mail.gmail.com> <a175dc17-9737-58c8-5819-f99a6c43a47c@aklaver.com> <CADbTQ2bYPqKaxFu78MNSufYSRSAkEksBifRJ_iCUnjRCBT9jVA@mail.gmail.com> <2f510eb0-86d7-b2fa-1397-5d16512c1234@aklaver.com> <CADbTQ2ZZ0POqB4ZMzV2UV5ikDNoB=Jo3V27fzQeQyNGwxd7cvw@mail.gmail.com> <CADbTQ2bypc9LwyVQ4hN0ykO0PGsEbaMeyVnB4eYyH-huOxXHNA@mail.gmail.com> <alpine.DEB.2.20.1804111430240.4018@z87>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox