pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Ivan Zhang <w.s.zhang@motorolasolutions.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: [issue?] SQLDriverConnect will clear existing connect attribute setting.
Date: Thu, 15 Jan 2015 10:53:03 +0200
Message-ID: <54B77FEF.4080201@vmware.com> (raw)
In-Reply-To: <BY1PR0401MB143087AD121D0251C00E5045A85B0@BY1PR0401MB1430.namprd04.prod.outlook.com>
References: <BY1PR0401MB143087AD121D0251C00E5045A85B0@BY1PR0401MB1430.namprd04.prod.outlook.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

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



view thread (2+ messages)

Message-ID: <54B77FEF.4080201@vmware.com>
Permalink:  ../54B77FEF.4080201@vmware.com/
Also on:    postgresql.org/message-id/54B77FEF.4080201@vmware.com

 · 

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-odbc@postgresql.org
  Cc: hlinnakangas@vmware.com, w.s.zhang@motorolasolutions.com
  Subject: Re: [issue?] SQLDriverConnect will clear existing connect attribute setting.
  In-Reply-To: <54B77FEF.4080201@vmware.com>
  References: <BY1PR0401MB143087AD121D0251C00E5045A85B0@BY1PR0401MB1430.namprd04.prod.outlook.com> <54B77FEF.4080201@vmware.com>

* 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