Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6KYQ-0006Hh-MA for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 18:33:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f6KYP-0005Yz-9k for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 18:33:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6KYO-0005YR-W4 for pgsql-general@lists.postgresql.org; Wed, 11 Apr 2018 18:33:09 +0000 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f6KYM-00071C-12 for pgsql-general@postgresql.org; Wed, 11 Apr 2018 18:33:08 +0000 Received: by mail-qt0-x242.google.com with SMTP id g5so3043144qth.7 for ; Wed, 11 Apr 2018 11:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=xMTGezq8PM+n4b742YYuUtJad5ATPHU9ppamDPXBUgQ=; b=uRPJCMWlo7P3topGAdjAxE32tmByNevZKQaOvhtGmeYnIrfWS+aqr1pf5jFS0OH+Ta DOotI96lvEMCgKlcV2ipb0L2gu4iCm+mE0kQwGgy8n/aW71v0tzQwFPitVTixg6Yt7Gw +aegAJWhLogj0DedEfdLHwQFwLhkGGnc+nJ/mn8byzQhqEbRb4RcDVfTL5e6ivEys0WN EPUdeta1P25tm7YpfcYVJmGFH5VRVNJUGTdCCLrxrycKuSu21Qku+L/ajcRT6Lxu3yyI x+WF6wkbmcCay8AwUMunduz7NPcrH3xsPwaKjZBp10ICpaOMZ60DwqzgjmbBk+YiYLwD 1pDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=xMTGezq8PM+n4b742YYuUtJad5ATPHU9ppamDPXBUgQ=; b=eloVJr4eT+Pd8uuNviYZPOL3k+T8gQOZ6q0QI92i1rIEqz4JjU1PY+JYdhidamgnfq Cx0Q5kd/Nk2Z0CApWfoJh1wfVjZkx7IpbvwiNCfxw2LDgcaKLqFdxHYFFLhWqXVlBd3v t11ZItdK8tg9VviatHaldRmf4Wb/V3AkZj2Jlu7tgKciI3rnspKhpiWGBOf2RTQJG3nW eSvjEQKX6XL6WMyl3peHPPikIsPYsC5dQ1F6XBofLtnpMULsAdrW5P9YKW27EoesJdt+ a1jXvGHjI1K3oSATt2NckeKQLFZiKexP+Gp/lPTNuSxWWnSF2Bhqm4XV+1uJAdLtSn3K iclw== X-Gm-Message-State: ALQs6tDASbisg0eePTQ9ywWFRUcmjhUUTfom+bCXa6BwvFvnHx3wTS+M QXrsGWCnIg3vxthwNFCCpKg= X-Google-Smtp-Source: AIpwx4/owG8HVifVFiVltaL54LLezXlm68W8LctpIetYypIXTE0a0dWBtA1MZ4q3oWqo02T6lxSjJQ== X-Received: by 10.200.26.69 with SMTP id q5mr8827493qtk.174.1523471582870; Wed, 11 Apr 2018 11:33:02 -0700 (PDT) Received: from [192.168.245.27] ([65.183.149.206]) by smtp.gmail.com with ESMTPSA id f14sm1461315qte.70.2018.04.11.11.33.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 11:33:02 -0700 (PDT) Date: Wed, 11 Apr 2018 14:33:01 -0400 (EDT) From: Steven Hirsch X-X-Sender: hirsch@z87 To: karthik kumar cc: Adrian Klaver , pgsql-general@postgresql.org Subject: Re: Fwd: Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2 In-Reply-To: Message-ID: References: <2aef0ab7-8854-978a-aae0-7e3cf6214c79@aklaver.com> <2f510eb0-86d7-b2fa-1397-5d16512c1234@aklaver.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1124955373-1523471582=:4018" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1124955373-1523471582=:4018 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT 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. -- --8323329-1124955373-1523471582=:4018--