Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YBgBP-0002BP-Ng for pgsql-odbc@arkaria.postgresql.org; Thu, 15 Jan 2015 08:53:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YBgBO-0007sG-Lf for pgsql-odbc@arkaria.postgresql.org; Thu, 15 Jan 2015 08:53:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YBgBN-0007s9-QA for pgsql-odbc@postgresql.org; Thu, 15 Jan 2015 08:53:37 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YBgBF-0005Rx-47 for pgsql-odbc@postgresql.org; Thu, 15 Jan 2015 08:53:32 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 3105C28EC0; Thu, 15 Jan 2015 00:53:24 -0800 (PST) Received: from EX13-CAS-006.vmware.com (EX13-CAS-006.vmware.com [10.113.191.56]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 2D3DC19848; Thu, 15 Jan 2015 00:53:24 -0800 (PST) Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.913.22; Thu, 15 Jan 2015 00:53:18 -0800 Message-ID: <54B77FEF.4080201@vmware.com> Date: Thu, 15 Jan 2015 10:53:03 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: Ivan Zhang , "pgsql-odbc@postgresql.org" Subject: Re: [issue?] SQLDriverConnect will clear existing connect attribute setting. References: In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 01/04/2015 08:11 AM, Ivan Zhang wrote: > I have a library to connect different database with ODBC. Found it's not work on postgresql by setting autocommit off. > > SQLSetConnectAttr(hDbc, > SQL_ATTR_AUTOCOMMIT, > (SQLPOINTER) SQL_AUTOCOMMIT_OFF, > 0) > > SQLDriverConnect(hDbc, > GetDesktopWindow(), > wszConnStr, > SQL_NTS, > NULL, > 0, > NULL, > SQL_DRIVER_COMPLETE); > > After checked the source, found that > > PGAPI_Connect init the connection attribute/option in CC_conninfo_init. > > So I have to set connect Attribute after Connect. Is this expected? > > SQLDriverConnect -> SQLSetConnectAttr > > It's different with ODBC interface expected(allocate -> set -> connect). It's a bug. It should be possible to set SQL_ATTR_AUTOCOMMIT before establishing connection. Fixed, thanks for the report! - Heikki -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc