Thread: changed behavior in libpq odbc driver

changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
I'm not sure whether the old driver or the new one is correct.

When executing an UPDATE query with a WHERE clause, if the WHERE clause does not match any rows, the old driver returns
SQL_NO_DATA. The new driver returns SQL_SUCCESS. 



Re: changed behavior in libpq odbc driver

From
"Anoop Kumar"
Date:
Hi Scot,

Can you provide the following details?
    1. The psqlodbc (socket) version you used
    2. PostgreSQL version
    3. OS

Regards

Anoop

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-
> owner@postgresql.org] On Behalf Of Scot Loach
> Sent: Thursday, August 18, 2005 7:18 AM
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] changed behavior in libpq odbc driver
>
> I'm not sure whether the old driver or the new one is correct.
>
> When executing an UPDATE query with a WHERE clause, if the WHERE
clause
> does not match any rows, the old driver returns SQL_NO_DATA.  The new
> driver returns SQL_SUCCESS.
>
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
OS is FreeBSD 5.4, but I really don't think this matters.
PostgreSQL 7.4.6
old psqlodbc is version 07.03.0200, but it has various updates applied to it.
new psqlodbc is the latest from CVS as of about a week ago.


-----Original Message-----
From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
Sent: Thursday, August 18, 2005 6:23 AM
To: Scot Loach; pgsql-odbc@postgresql.org
Subject: RE: [ODBC] changed behavior in libpq odbc driver


Hi Scot,

Can you provide the following details?
    1. The psqlodbc (socket) version you used
    2. PostgreSQL version
    3. OS

Regards

Anoop

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-
> owner@postgresql.org] On Behalf Of Scot Loach
> Sent: Thursday, August 18, 2005 7:18 AM
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] changed behavior in libpq odbc driver
>
> I'm not sure whether the old driver or the new one is correct.
>
> When executing an UPDATE query with a WHERE clause, if the WHERE
clause
> does not match any rows, the old driver returns SQL_NO_DATA.  The new
> driver returns SQL_SUCCESS.
>
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
Another difference is the "state" that is returned from SQLGetDiagRec when a connection is lost during a query.  This
usedto return 08S01.  It now returns HY000.  From the documentation it would appear that 08S01 is the correct return
codein this case.  I'm guessing the error codes are not implemented in the libpq version of the driver yet. 

Also, SQLGetConnectAttr with SQL_ATTR_CONNECTION_DEAD doesn't seem to work anymore.



-----Original Message-----
From:    pgsql-odbc-owner@postgresql.org on behalf of Scot Loach
Sent:    Thu 8/18/2005 10:03 AM
To:    Anoop Kumar; pgsql-odbc@postgresql.org
Cc:
Subject:    Re: [ODBC] changed behavior in libpq odbc driver
OS is FreeBSD 5.4, but I really don't think this matters.
PostgreSQL 7.4.6
old psqlodbc is version 07.03.0200, but it has various updates applied to it.
new psqlodbc is the latest from CVS as of about a week ago.


-----Original Message-----
From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
Sent: Thursday, August 18, 2005 6:23 AM
To: Scot Loach; pgsql-odbc@postgresql.org
Subject: RE: [ODBC] changed behavior in libpq odbc driver


Hi Scot,

Can you provide the following details?
    1. The psqlodbc (socket) version you used
    2. PostgreSQL version
    3. OS

Regards

Anoop

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-
> owner@postgresql.org] On Behalf Of Scot Loach
> Sent: Thursday, August 18, 2005 7:18 AM
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] changed behavior in libpq odbc driver
>
> I'm not sure whether the old driver or the new one is correct.
>
> When executing an UPDATE query with a WHERE clause, if the WHERE
clause
> does not match any rows, the old driver returns SQL_NO_DATA.  The new
> driver returns SQL_SUCCESS.
>
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly



Re: changed behavior in libpq odbc driver

From
Marko Ristola
Date:
Please check, but ODBC 3 should return SQL_NO_DATA, when
no data has been updated.

ODBC 2 should return SQL_SUCCESS wether any rows were updated, or not.

So it depends on the ODBC standard, that the client program chooses.

Marko Ristola

Scot Loach wrote:

>I'm not sure whether the old driver or the new one is correct.
>
>When executing an UPDATE query with a WHERE clause, if the WHERE clause does not match any rows, the old driver
returnsSQL_NO_DATA.  The new driver returns SQL_SUCCESS. 
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 9: In versions below 8.0, the planner will ignore your desire to
>       choose an index scan if your joining column's datatypes do not
>       match
>
>


Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
Thanks for the clarification, Marko.
I use ODBC 3.0, so it would seem that this is a bug.

scot.


-----Original Message-----
From: pgsql-odbc-owner@postgresql.org
[mailto:pgsql-odbc-owner@postgresql.org]On Behalf Of Marko Ristola
Sent: Sunday, August 21, 2005 10:36 AM
Cc: pgsql-odbc@postgresql.org
Subject: Re: [ODBC] changed behavior in libpq odbc driver



Please check, but ODBC 3 should return SQL_NO_DATA, when
no data has been updated.

ODBC 2 should return SQL_SUCCESS wether any rows were updated, or not.

So it depends on the ODBC standard, that the client program chooses.

Marko Ristola

Scot Loach wrote:

>I'm not sure whether the old driver or the new one is correct.
>
>When executing an UPDATE query with a WHERE clause, if the WHERE clause does not match any rows, the old driver
returnsSQL_NO_DATA.  The new driver returns SQL_SUCCESS. 
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 9: In versions below 8.0, the planner will ignore your desire to
>       choose an index scan if your joining column's datatypes do not
>       match
>
>


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Re: changed behavior in libpq odbc driver

From
"Anoop Kumar"
Date:
Hi,

I have committed the patch for returning SQL_NO_DATA_FOUND instead of
SQL_SUCCESS when no rows got affected in UPDATE/DELETE. You may check it
out from the CVS.

Regards

Anoop

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-
> owner@postgresql.org] On Behalf Of Scot Loach
> Sent: Sunday, August 21, 2005 8:31 PM
> To: Marko Ristola
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] changed behavior in libpq odbc driver
>
> Thanks for the clarification, Marko.
> I use ODBC 3.0, so it would seem that this is a bug.
>
> scot.
>
>
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org]On Behalf Of Marko Ristola
> Sent: Sunday, August 21, 2005 10:36 AM
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] changed behavior in libpq odbc driver
>
>
>
> Please check, but ODBC 3 should return SQL_NO_DATA, when
> no data has been updated.
>
> ODBC 2 should return SQL_SUCCESS wether any rows were updated, or not.
>
> So it depends on the ODBC standard, that the client program chooses.
>
> Marko Ristola
>
> Scot Loach wrote:
>
> >I'm not sure whether the old driver or the new one is correct.
> >
> >When executing an UPDATE query with a WHERE clause, if the WHERE
clause
> does not match any rows, the old driver returns SQL_NO_DATA.  The new
> driver returns SQL_SUCCESS.
> >
> >
> >
> >---------------------------(end of
broadcast)---------------------------
> >TIP 9: In versions below 8.0, the planner will ignore your desire to
> >       choose an index scan if your joining column's datatypes do not
> >       match
> >
> >
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Anoop Kumar
> Sent: 24 August 2005 07:17
> To: Scot Loach
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] changed behavior in libpq odbc driver
>
> Hi,
>
> I have committed the patch for returning SQL_NO_DATA_FOUND instead of
> SQL_SUCCESS when no rows got affected in UPDATE/DELETE. You
> may check it
> out from the CVS.

Ahh, one less item on my todo :-)

Do you intend to fix the state code problem and dead connection
detection issues reported by Scot as well?

<sob story>it would really help me if you could as I've got a bunch of
other stuff to do :-( </sob story>

:-)

Regards, Dave.

Re: changed behavior in libpq odbc driver

From
"Anoop Kumar"
Date:
Hi Dave,

OK, I shall look into the state code problem and dead connection
detection issues. :-)

Regards

Anoop

> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Wednesday, August 24, 2005 3:16 PM
> To: Anoop Kumar; Scot Loach
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
>
>
> > -----Original Message-----
> > From: pgsql-odbc-owner@postgresql.org
> > [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Anoop Kumar
> > Sent: 24 August 2005 07:17
> > To: Scot Loach
> > Cc: pgsql-odbc@postgresql.org
> > Subject: Re: [ODBC] changed behavior in libpq odbc driver
> >
> > Hi,
> >
> > I have committed the patch for returning SQL_NO_DATA_FOUND instead
of
> > SQL_SUCCESS when no rows got affected in UPDATE/DELETE. You
> > may check it
> > out from the CVS.
>
> Ahh, one less item on my todo :-)
>
> Do you intend to fix the state code problem and dead connection
> detection issues reported by Scot as well?
>
> <sob story>it would really help me if you could as I've got a bunch of
> other stuff to do :-( </sob story>
>
> :-)
>
> Regards, Dave.

Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:
Thanks  :-)


-----Original Message-----
From: "Anoop Kumar"<anoopk@pervasive-postgres.com>
Sent: 25/08/05 06:56:58
To: "Dave Page"<dpage@vale-housing.co.uk>, "Scot Loach"<sloach@sandvine.com>
Cc: "pgsql-odbc@postgresql.org"<pgsql-odbc@postgresql.org>
Subject: RE: [ODBC] changed behavior in libpq odbc driver

Hi Dave,

OK, I shall look into the state code problem and dead connection
detection issues. :-)

Regards

Anoop

> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Wednesday, August 24, 2005 3:16 PM
> To: Anoop Kumar; Scot Loach
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
>
>
> > -----Original Message-----
> > From: pgsql-odbc-owner@postgresql.org
> > [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Anoop Kumar
> > Sent: 24 August 2005 07:17
> > To: Scot Loach
> > Cc: pgsql-odbc@postgresql.org
> > Subject: Re: [ODBC] changed behavior in libpq odbc driver
> >
> > Hi,
> >
> > I have committed the patch for returning SQL_NO_DATA_FOUND instead
of
> > SQL_SUCCESS when no rows got affected in UPDATE/DELETE. You
> > may check it
> > out from the CVS.
>
> Ahh, one less item on my todo :-)
>
> Do you intend to fix the state code problem and dead connection
> detection issues reported by Scot as well?
>
> <sob story>it would really help me if you could as I've got a bunch of
> other stuff to do :-( </sob story>
>
> :-)
>
> Regards, Dave.



-----Unmodified Original Message-----
Hi Dave,

OK, I shall look into the state code problem and dead connection
detection issues. :-)

Regards

Anoop

> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Wednesday, August 24, 2005 3:16 PM
> To: Anoop Kumar; Scot Loach
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
>
>
> > -----Original Message-----
> > From: pgsql-odbc-owner@postgresql.org
> > [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Anoop Kumar
> > Sent: 24 August 2005 07:17
> > To: Scot Loach
> > Cc: pgsql-odbc@postgresql.org
> > Subject: Re: [ODBC] changed behavior in libpq odbc driver
> >
> > Hi,
> >
> > I have committed the patch for returning SQL_NO_DATA_FOUND instead
of
> > SQL_SUCCESS when no rows got affected in UPDATE/DELETE. You
> > may check it
> > out from the CVS.
>
> Ahh, one less item on my todo :-)
>
> Do you intend to fix the state code problem and dead connection
> detection issues reported by Scot as well?
>
> <sob story>it would really help me if you could as I've got a bunch of
> other stuff to do :-( </sob story>
>
> :-)
>
> Regards, Dave.

Re: changed behavior in libpq odbc driver

From
Zoltan Boszormenyi
Date:
Hi,

Anoop Kumar írta:
> Hi Dave,
>
> OK, I shall look into the state code problem and dead connection
> detection issues. :-)
>
> Regards
>
> Anoop

is there any chance, guys, that you can make SQLCancel() work
any time soon?

Thanks,
Zoltán Böszörményi

>>-----Original Message-----
>>From: Dave Page [mailto:dpage@vale-housing.co.uk]
>>Sent: Wednesday, August 24, 2005 3:16 PM
>>To: Anoop Kumar; Scot Loach
>>Cc: pgsql-odbc@postgresql.org
>>Subject: RE: [ODBC] changed behavior in libpq odbc driver
>>
>>
>>
>>
>>>-----Original Message-----
>>>From: pgsql-odbc-owner@postgresql.org
>>>[mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Anoop Kumar
>>>Sent: 24 August 2005 07:17
>>>To: Scot Loach
>>>Cc: pgsql-odbc@postgresql.org
>>>Subject: Re: [ODBC] changed behavior in libpq odbc driver
>>>
>>>Hi,
>>>
>>>I have committed the patch for returning SQL_NO_DATA_FOUND instead
>
> of
>
>>>SQL_SUCCESS when no rows got affected in UPDATE/DELETE. You
>>>may check it
>>>out from the CVS.
>>
>>Ahh, one less item on my todo :-)
>>
>>Do you intend to fix the state code problem and dead connection
>>detection issues reported by Scot as well?
>>
>><sob story>it would really help me if you could as I've got a bunch of
>>other stuff to do :-( </sob story>
>>
>>:-)
>>
>>Regards, Dave.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>


Re: changed behavior in libpq odbc driver

From
"Anoop Kumar"
Date:
Hi All,

Here is a patch for the following bug pointed out by Scot.

"SQLGetConnectAttr with SQL_ATTR_CONNECTION_DEAD doesn't seem to work
anymore."

I request you to review this patch.

Regards

Anoop

> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Thursday, August 25, 2005 2:16 PM
> To: Anoop Kumar; dpage@vale-housing.co.uk; sloach@sandvine.com
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> Thanks  :-)
>
>
> -----Original Message-----
> From: "Anoop Kumar"<anoopk@pervasive-postgres.com>
> Sent: 25/08/05 06:56:58
> To: "Dave Page"<dpage@vale-housing.co.uk>, "Scot
> Loach"<sloach@sandvine.com>
> Cc: "pgsql-odbc@postgresql.org"<pgsql-odbc@postgresql.org>
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> Hi Dave,
>
> OK, I shall look into the state code problem and dead connection
> detection issues. :-)
>
> Regards
>
> Anoop
>
> > -----Original Message-----
> > From: Dave Page [mailto:dpage@vale-housing.co.uk]
> > Sent: Wednesday, August 24, 2005 3:16 PM
> > To: Anoop Kumar; Scot Loach
> > Cc: pgsql-odbc@postgresql.org
> > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> >
> >
> >
> > > -----Original Message-----
> > > From: pgsql-odbc-owner@postgresql.org
> > > [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Anoop Kumar
> > > Sent: 24 August 2005 07:17
> > > To: Scot Loach
> > > Cc: pgsql-odbc@postgresql.org
> > > Subject: Re: [ODBC] changed behavior in libpq odbc driver
> > >
> > > Hi,
> > >
> > > I have committed the patch for returning SQL_NO_DATA_FOUND instead
> of
> > > SQL_SUCCESS when no rows got affected in UPDATE/DELETE. You
> > > may check it
> > > out from the CVS.
> >
> > Ahh, one less item on my todo :-)
> >
> > Do you intend to fix the state code problem and dead connection
> > detection issues reported by Scot as well?
> >
> > <sob story>it would really help me if you could as I've got a bunch
of
> > other stuff to do :-( </sob story>
> >
> > :-)
> >
> > Regards, Dave.
>
>
>
> -----Unmodified Original Message-----
> Hi Dave,
>
> OK, I shall look into the state code problem and dead connection
> detection issues. :-)
>
> Regards
>
> Anoop
>
> > -----Original Message-----
> > From: Dave Page [mailto:dpage@vale-housing.co.uk]
> > Sent: Wednesday, August 24, 2005 3:16 PM
> > To: Anoop Kumar; Scot Loach
> > Cc: pgsql-odbc@postgresql.org
> > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> >
> >
> >
> > > -----Original Message-----
> > > From: pgsql-odbc-owner@postgresql.org
> > > [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Anoop Kumar
> > > Sent: 24 August 2005 07:17
> > > To: Scot Loach
> > > Cc: pgsql-odbc@postgresql.org
> > > Subject: Re: [ODBC] changed behavior in libpq odbc driver
> > >
> > > Hi,
> > >
> > > I have committed the patch for returning SQL_NO_DATA_FOUND instead
> of
> > > SQL_SUCCESS when no rows got affected in UPDATE/DELETE. You
> > > may check it
> > > out from the CVS.
> >
> > Ahh, one less item on my todo :-)
> >
> > Do you intend to fix the state code problem and dead connection
> > detection issues reported by Scot as well?
> >
> > <sob story>it would really help me if you could as I've got a bunch
of
> > other stuff to do :-( </sob story>
> >
> > :-)
> >
> > Regards, Dave.

Attachment

Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:
> -----Original Message-----
> From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
> Sent: 30 August 2005 06:05
> To: Dave Page; sloach@sandvine.com
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> Hi All,
>
> Here is a patch for the following bug pointed out by Scot.
>
> "SQLGetConnectAttr with SQL_ATTR_CONNECTION_DEAD doesn't seem to work
> anymore."
>
> I request you to review this patch.

Looks good to me.

You'll apply it?

Regards, Dave

Re: changed behavior in libpq odbc driver

From
"Anoop Kumar"
Date:
Hi Dave,

The patch is applied.

Regards

Anoop

> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Tuesday, August 30, 2005 2:24 PM
> To: Anoop Kumar; sloach@sandvine.com
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
>
> > -----Original Message-----
> > From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
> > Sent: 30 August 2005 06:05
> > To: Dave Page; sloach@sandvine.com
> > Cc: pgsql-odbc@postgresql.org
> > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> >
> > Hi All,
> >
> > Here is a patch for the following bug pointed out by Scot.
> >
> > "SQLGetConnectAttr with SQL_ATTR_CONNECTION_DEAD doesn't seem to
work
> > anymore."
> >
> > I request you to review this patch.
>
> Looks good to me.
>
> You'll apply it?
>
> Regards, Dave

Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:
Thanks Anoop.

/D

> -----Original Message-----
> From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
> Sent: 30 August 2005 10:21
> To: Dave Page; sloach@sandvine.com
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> Hi Dave,
>
> The patch is applied.
>
> Regards
>
> Anoop
>
> > -----Original Message-----
> > From: Dave Page [mailto:dpage@vale-housing.co.uk]
> > Sent: Tuesday, August 30, 2005 2:24 PM
> > To: Anoop Kumar; sloach@sandvine.com
> > Cc: pgsql-odbc@postgresql.org
> > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> >
> >
> > > -----Original Message-----
> > > From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
> > > Sent: 30 August 2005 06:05
> > > To: Dave Page; sloach@sandvine.com
> > > Cc: pgsql-odbc@postgresql.org
> > > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> > >
> > > Hi All,
> > >
> > > Here is a patch for the following bug pointed out by Scot.
> > >
> > > "SQLGetConnectAttr with SQL_ATTR_CONNECTION_DEAD doesn't seem to
> work
> > > anymore."
> > >
> > > I request you to review this patch.
> >
> > Looks good to me.
> >
> > You'll apply it?
> >
> > Regards, Dave
>

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
Thanks guys, I've verified that this works.

Any update on getting the sql error codes fixed?


-----Original Message-----
From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
Sent: Tuesday, August 30, 2005 5:21 AM
To: Dave Page; Scot Loach
Cc: pgsql-odbc@postgresql.org
Subject: RE: [ODBC] changed behavior in libpq odbc driver


Hi Dave,

The patch is applied.

Regards

Anoop

> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Tuesday, August 30, 2005 2:24 PM
> To: Anoop Kumar; sloach@sandvine.com
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
>
> > -----Original Message-----
> > From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
> > Sent: 30 August 2005 06:05
> > To: Dave Page; sloach@sandvine.com
> > Cc: pgsql-odbc@postgresql.org
> > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> >
> > Hi All,
> >
> > Here is a patch for the following bug pointed out by Scot.
> >
> > "SQLGetConnectAttr with SQL_ATTR_CONNECTION_DEAD doesn't seem to
work
> > anymore."
> >
> > I request you to review this patch.
>
> Looks good to me.
>
> You'll apply it?
>
> Regards, Dave

Re: changed behavior in libpq odbc driver

From
"Anoop Kumar"
Date:
Hi Scot,

I will post the fix for the sql error codes today.

Regards

Anoop

> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: Tuesday, August 30, 2005 11:27 PM
> To: Anoop Kumar; Dave Page
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> Thanks guys, I've verified that this works.
>
> Any update on getting the sql error codes fixed?
>
>
> -----Original Message-----
> From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
> Sent: Tuesday, August 30, 2005 5:21 AM
> To: Dave Page; Scot Loach
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
>
> Hi Dave,
>
> The patch is applied.
>
> Regards
>
> Anoop
>
> > -----Original Message-----
> > From: Dave Page [mailto:dpage@vale-housing.co.uk]
> > Sent: Tuesday, August 30, 2005 2:24 PM
> > To: Anoop Kumar; sloach@sandvine.com
> > Cc: pgsql-odbc@postgresql.org
> > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> >
> >
> > > -----Original Message-----
> > > From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
> > > Sent: 30 August 2005 06:05
> > > To: Dave Page; sloach@sandvine.com
> > > Cc: pgsql-odbc@postgresql.org
> > > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> > >
> > > Hi All,
> > >
> > > Here is a patch for the following bug pointed out by Scot.
> > >
> > > "SQLGetConnectAttr with SQL_ATTR_CONNECTION_DEAD doesn't seem to
> work
> > > anymore."
> > >
> > > I request you to review this patch.
> >
> > Looks good to me.
> >
> > You'll apply it?
> >
> > Regards, Dave

Re: changed behavior in libpq odbc driver

From
"Anoop Kumar"
Date:
Hi All,

Please find the patch for the other bug pointed out by Scot. (Thanks to
Sivakumar)

"Another difference is the "state" that is returned from SQLGetDiagRec
when a connection is lost during a query.  This used to return 08S01.
It now returns HY000."

I request you to review this patch as well.

Regards

Anoop

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-
> owner@postgresql.org] On Behalf Of Scot Loach
> Sent: Sunday, August 21, 2005 8:31 PM
> To: Marko Ristola
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] changed behavior in libpq odbc driver
>
> Thanks for the clarification, Marko.
> I use ODBC 3.0, so it would seem that this is a bug.
>
> scot.
>
>
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org]On Behalf Of Marko Ristola
> Sent: Sunday, August 21, 2005 10:36 AM
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] changed behavior in libpq odbc driver
>
>
>
> Please check, but ODBC 3 should return SQL_NO_DATA, when
> no data has been updated.
>
> ODBC 2 should return SQL_SUCCESS wether any rows were updated, or not.
>
> So it depends on the ODBC standard, that the client program chooses.
>
> Marko Ristola
>
> Scot Loach wrote:
>
> >I'm not sure whether the old driver or the new one is correct.
> >
> >When executing an UPDATE query with a WHERE clause, if the WHERE
clause
> does not match any rows, the old driver returns SQL_NO_DATA.  The new
> driver returns SQL_SUCCESS.
> >
> >
> >
> >---------------------------(end of
broadcast)---------------------------
> >TIP 9: In versions below 8.0, the planner will ignore your desire to
> >       choose an index scan if your joining column's datatypes do not
> >       match
> >
> >
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

Attachment

Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:

> -----Original Message-----
> From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
> Sent: 31 August 2005 06:51
> To: Scot Loach
> Cc: pgsql-odbc@postgresql.org; Dave Page
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> Hi All,
>
> Please find the patch for the other bug pointed out by Scot.
> (Thanks to
> Sivakumar)
>
> "Another difference is the "state" that is returned from SQLGetDiagRec
> when a connection is lost during a query.  This used to return 08S01.
> It now returns HY000."
>
> I request you to review this patch as well.

Hi Anoop,

This works well for me, and looks OK. I've committed it as I had all the
right windows etc. open already :-)

Thanks to Sivakumar.

Regards, Dave.

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
That didn't fix it, it still returns HY000.

This is the error message that comes back:

FATAL:  terminating connection due to administrator command
server closed the connection unexpectedly
This probably means the server terminated abnormally


-----Original Message-----
From: Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
Sent: Wednesday, August 31, 2005 1:51 AM
To: Scot Loach
Cc: pgsql-odbc@postgresql.org; Dave Page
Subject: RE: [ODBC] changed behavior in libpq odbc driver


Hi All,

Please find the patch for the other bug pointed out by Scot. (Thanks to
Sivakumar)

"Another difference is the "state" that is returned from SQLGetDiagRec
when a connection is lost during a query.  This used to return 08S01.
It now returns HY000."

I request you to review this patch as well.

Regards

Anoop

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-
> owner@postgresql.org] On Behalf Of Scot Loach
> Sent: Sunday, August 21, 2005 8:31 PM
> To: Marko Ristola
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] changed behavior in libpq odbc driver
>
> Thanks for the clarification, Marko.
> I use ODBC 3.0, so it would seem that this is a bug.
>
> scot.
>
>
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org]On Behalf Of Marko Ristola
> Sent: Sunday, August 21, 2005 10:36 AM
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] changed behavior in libpq odbc driver
>
>
>
> Please check, but ODBC 3 should return SQL_NO_DATA, when
> no data has been updated.
>
> ODBC 2 should return SQL_SUCCESS wether any rows were updated, or not.
>
> So it depends on the ODBC standard, that the client program chooses.
>
> Marko Ristola
>
> Scot Loach wrote:
>
> >I'm not sure whether the old driver or the new one is correct.
> >
> >When executing an UPDATE query with a WHERE clause, if the WHERE
clause
> does not match any rows, the old driver returns SQL_NO_DATA.  The new
> driver returns SQL_SUCCESS.
> >
> >
> >
> >---------------------------(end of
broadcast)---------------------------
> >TIP 9: In versions below 8.0, the planner will ignore your desire to
> >       choose an index scan if your joining column's datatypes do not
> >       match
> >
> >
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:

> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 31 August 2005 13:52
> To: Anoop Kumar
> Cc: pgsql-odbc@postgresql.org; Dave Page
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> That didn't fix it, it still returns HY000.
>
> This is the error message that comes back:
>
> FATAL:  terminating connection due to administrator command
> server closed the connection unexpectedly
> This probably means the server terminated abnormally

Odd - it works for me:

    Successfully connected to DSN 'unicode'.
SQLGetInfo:
                In:
ConnectionHandle = 0x003B14B8, InfoType = SQL_DBMS_VER=18, InfoValuePtr
= 0x000A73A0, BufferLength = 600, StringLengthPtr = 0x000ADFD8,

Information Value Type = SQL_C_WCHAR=-8
                Return:    SQL_SUCCESS=0
                Out:            *InfoValuePtr =
"08.01.0004 PostgreSQL 8.0.3 on i686-pc-mingw32, co...",
*StringLengthPtr = 173
SQLExecDirect:
                In:
Statementhandle = 0x003B16C0, StatementText = "SELECT version()",
Statementlength = 16
                Return:    SQL_ERROR=-1
                stmt:        szSqlState = "08S01",
*pfNativeError = 27, *pcbErrorMsg = 169, *ColumnNumber = -2, *RowNumber
= -2

MessageText = "Error while executing the query;
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request."


What steps are you using to repeat the failure at your end? I'm doing:

1) Open connection
2) Call SQLGetInfo and doubly confirm we're connected.
3) Stop the server.
4) Execute a query.

Regards, Dave

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
My mistake, I tried it again and it does seem to be working now - I must not have updated properly for my last compile.

scot.


-----Original Message-----
From: Dave Page [mailto:dpage@vale-housing.co.uk]
Sent: Wednesday, August 31, 2005 9:08 AM
To: Scot Loach; Anoop Kumar
Cc: pgsql-odbc@postgresql.org
Subject: RE: [ODBC] changed behavior in libpq odbc driver




> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 31 August 2005 13:52
> To: Anoop Kumar
> Cc: pgsql-odbc@postgresql.org; Dave Page
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> That didn't fix it, it still returns HY000.
>
> This is the error message that comes back:
>
> FATAL:  terminating connection due to administrator command
> server closed the connection unexpectedly
> This probably means the server terminated abnormally

Odd - it works for me:

    Successfully connected to DSN 'unicode'.
SQLGetInfo:
                In:
ConnectionHandle = 0x003B14B8, InfoType = SQL_DBMS_VER=18, InfoValuePtr
= 0x000A73A0, BufferLength = 600, StringLengthPtr = 0x000ADFD8,

Information Value Type = SQL_C_WCHAR=-8
                Return:    SQL_SUCCESS=0
                Out:            *InfoValuePtr =
"08.01.0004 PostgreSQL 8.0.3 on i686-pc-mingw32, co...",
*StringLengthPtr = 173
SQLExecDirect:
                In:
Statementhandle = 0x003B16C0, StatementText = "SELECT version()",
Statementlength = 16
                Return:    SQL_ERROR=-1
                stmt:        szSqlState = "08S01",
*pfNativeError = 27, *pcbErrorMsg = 169, *ColumnNumber = -2, *RowNumber
= -2

MessageText = "Error while executing the query;
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request."


What steps are you using to repeat the failure at your end? I'm doing:

1) Open connection
2) Call SQLGetInfo and doubly confirm we're connected.
3) Stop the server.
4) Execute a query.

Regards, Dave

Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:

> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 31 August 2005 14:47
> To: Dave Page; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> My mistake, I tried it again and it does seem to be working
> now - I must not have updated properly for my last compile.

Good. Were there any other issues that you reported that we've missed?

If not, once I've heard how this unicode patch looks from a few people,
I'll rename the driver and push out a new version (I'm keen to get this
done for pgInstaller 8.1 of course).

Regards, Dave

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
My initial attempt at using server side prepare didn't seem to work well...but I don't actually need this feature right
now,so I have no plans to investigate it further at this time. 


-----Original Message-----
From: Dave Page [mailto:dpage@vale-housing.co.uk]
Sent: Wednesday, August 31, 2005 10:17 AM
To: Scot Loach; Anoop Kumar
Cc: pgsql-odbc@postgresql.org
Subject: RE: [ODBC] changed behavior in libpq odbc driver




> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 31 August 2005 14:47
> To: Dave Page; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> My mistake, I tried it again and it does seem to be working
> now - I must not have updated properly for my last compile.

Good. Were there any other issues that you reported that we've missed?

If not, once I've heard how this unicode patch looks from a few people,
I'll rename the driver and push out a new version (I'm keen to get this
done for pgInstaller 8.1 of course).

Regards, Dave

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
I've found a problem with this.
This causes the correct state to be returned on db disconnect, great.
Unfortunately 08S01 is now returned for other errors as well.
For example, trying to insert a row with a duplicate key into a table will cause 08S01 to be returned now, this was not
thebehavior before. 

scot.



-----Original Message-----
From:    Anoop Kumar [mailto:anoopk@pervasive-postgres.com]
Sent:    Wed 8/31/2005 1:51 AM
To:    Scot Loach
Cc:    pgsql-odbc@postgresql.org; Dave Page
Subject:    RE: [ODBC] changed behavior in libpq odbc driver
Hi All,

Please find the patch for the other bug pointed out by Scot. (Thanks to
Sivakumar)

"Another difference is the "state" that is returned from SQLGetDiagRec
when a connection is lost during a query.  This used to return 08S01.
It now returns HY000."

I request you to review this patch as well.

Regards

Anoop

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-
> owner@postgresql.org] On Behalf Of Scot Loach
> Sent: Sunday, August 21, 2005 8:31 PM
> To: Marko Ristola
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] changed behavior in libpq odbc driver
>
> Thanks for the clarification, Marko.
> I use ODBC 3.0, so it would seem that this is a bug.
>
> scot.
>
>
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org]On Behalf Of Marko Ristola
> Sent: Sunday, August 21, 2005 10:36 AM
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] changed behavior in libpq odbc driver
>
>
>
> Please check, but ODBC 3 should return SQL_NO_DATA, when
> no data has been updated.
>
> ODBC 2 should return SQL_SUCCESS wether any rows were updated, or not.
>
> So it depends on the ODBC standard, that the client program chooses.
>
> Marko Ristola
>
> Scot Loach wrote:
>
> >I'm not sure whether the old driver or the new one is correct.
> >
> >When executing an UPDATE query with a WHERE clause, if the WHERE
clause
> does not match any rows, the old driver returns SQL_NO_DATA.  The new
> driver returns SQL_SUCCESS.
> >
> >
> >
> >---------------------------(end of
broadcast)---------------------------
> >TIP 9: In versions below 8.0, the planner will ignore your desire to
> >       choose an index scan if your joining column's datatypes do not
> >       match
> >
> >
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster



Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:

> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 07 September 2005 01:32
> To: Anoop Kumar
> Cc: pgsql-odbc@postgresql.org; Dave Page
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> I've found a problem with this.
> This causes the correct state to be returned on db disconnect, great.
> Unfortunately 08S01 is now returned for other errors as well.
> For example, trying to insert a row with a duplicate key into
> a table will cause 08S01 to be returned now, this was not the
> behavior before.

That's already fixed in CVS.

http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/psqlodbc/psqlodbc/connection
.c.diff?r1=1.108&r2=1.109

Regards, Dave.

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
I'm pretty sure my driver had that change already.
I'll update and double check though.

-----Original Message-----
From: Dave Page [mailto:dpage@vale-housing.co.uk]
Sent: Wednesday, September 07, 2005 3:35 AM
To: Scot Loach; Anoop Kumar
Cc: pgsql-odbc@postgresql.org
Subject: RE: [ODBC] changed behavior in libpq odbc driver




> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 07 September 2005 01:32
> To: Anoop Kumar
> Cc: pgsql-odbc@postgresql.org; Dave Page
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> I've found a problem with this.
> This causes the correct state to be returned on db disconnect, great.
> Unfortunately 08S01 is now returned for other errors as well.
> For example, trying to insert a row with a duplicate key into
> a table will cause 08S01 to be returned now, this was not the
> behavior before.

That's already fixed in CVS.

http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/psqlodbc/psqlodbc/connection
.c.diff?r1=1.108&r2=1.109

Regards, Dave.

Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:
Hmm, I hope not - the dup key test was the main one I used when testing!

/D

> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 07 September 2005 13:10
> To: Dave Page; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> I'm pretty sure my driver had that change already.
> I'll update and double check though.
>
> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Wednesday, September 07, 2005 3:35 AM
> To: Scot Loach; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
>
>
>
> > -----Original Message-----
> > From: Scot Loach [mailto:sloach@sandvine.com]
> > Sent: 07 September 2005 01:32
> > To: Anoop Kumar
> > Cc: pgsql-odbc@postgresql.org; Dave Page
> > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> >
> > I've found a problem with this.
> > This causes the correct state to be returned on db
> disconnect, great.
> > Unfortunately 08S01 is now returned for other errors as well.
> > For example, trying to insert a row with a duplicate key into
> > a table will cause 08S01 to be returned now, this was not the
> > behavior before.
>
> That's already fixed in CVS.
>
> http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/psqlodbc/psqlodbc/
> connection
> .c.diff?r1=1.108&r2=1.109
>
> Regards, Dave.
>

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
so I'm definitely still able to reproduce this problem.
The test I'm running is somewhat complex, I can work on simplifying it.
Maybe the error code is left around from before and not properly cleared?

-----Original Message-----
From: Dave Page [mailto:dpage@vale-housing.co.uk]
Sent: Wednesday, September 07, 2005 8:23 AM
To: Scot Loach; Anoop Kumar
Cc: pgsql-odbc@postgresql.org
Subject: RE: [ODBC] changed behavior in libpq odbc driver


Hmm, I hope not - the dup key test was the main one I used when testing!

/D

> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 07 September 2005 13:10
> To: Dave Page; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> I'm pretty sure my driver had that change already.
> I'll update and double check though.
>
> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Wednesday, September 07, 2005 3:35 AM
> To: Scot Loach; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
>
>
>
> > -----Original Message-----
> > From: Scot Loach [mailto:sloach@sandvine.com]
> > Sent: 07 September 2005 01:32
> > To: Anoop Kumar
> > Cc: pgsql-odbc@postgresql.org; Dave Page
> > Subject: RE: [ODBC] changed behavior in libpq odbc driver
> >
> > I've found a problem with this.
> > This causes the correct state to be returned on db
> disconnect, great.
> > Unfortunately 08S01 is now returned for other errors as well.
> > For example, trying to insert a row with a duplicate key into
> > a table will cause 08S01 to be returned now, this was not the
> > behavior before.
>
> That's already fixed in CVS.
>
> http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/psqlodbc/psqlodbc/
> connection
> .c.diff?r1=1.108&r2=1.109
>
> Regards, Dave.
>

Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:

> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 07 September 2005 13:48
> To: Dave Page; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> so I'm definitely still able to reproduce this problem.
> The test I'm running is somewhat complex, I can work on
> simplifying it.
> Maybe the error code is left around from before and not
> properly cleared?

Well the only time the error code should be set is if libpq reports the
connection as being bad, so if you're definitely seeing it, it must be
coming from somewhere else, or you're not checking the error code when
it actually arrives.

Can you add a mylog line into the relevant part of the fix I posted so
youo can see if the error code is being set somewhen that you don't
otherwise notice?

Regards Dave

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
Ok, I did the check you suggested.
The error code is not getting set at that point in the code.
There must be some other place where it can get set to that.

-----Original Message-----
From:    Dave Page [mailto:dpage@vale-housing.co.uk]
Sent:    Wed 9/7/2005 9:02 AM
To:    Scot Loach; Anoop Kumar
Cc:    pgsql-odbc@postgresql.org
Subject:    RE: [ODBC] changed behavior in libpq odbc driver


> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 07 September 2005 13:48
> To: Dave Page; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> so I'm definitely still able to reproduce this problem.
> The test I'm running is somewhat complex, I can work on
> simplifying it.
> Maybe the error code is left around from before and not
> properly cleared?

Well the only time the error code should be set is if libpq reports the
connection as being bad, so if you're definitely seeing it, it must be
coming from somewhere else, or you're not checking the error code when
it actually arrives.

Can you add a mylog line into the relevant part of the fix I posted so
youo can see if the error code is being set somewhen that you don't
otherwise notice?

Regards Dave



Re: changed behavior in libpq odbc driver

From
"Dave Page"
Date:

> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 08 September 2005 02:39
> To: Dave Page; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> Ok, I did the check you suggested.
> The error code is not getting set at that point in the code.
> There must be some other place where it can get set to that.

Can you send a minimal mylog showing the problem?

Thanks, Dave

Re: changed behavior in libpq odbc driver

From
"Scot Loach"
Date:
In LIBPQ_execute_query():

        qres->status = PQresultStatus(pgres);

In the bad primary key case, this returns PGRES_FATAL_ERROR.


Then, in SC_execute():

        /* Check the status of the result */
        if (res)
        {
                was_ok = QR_command_successful(res);
                was_nonfatal = QR_command_nonfatal(res);
                was_fatal = QR_command_fatal(res);

                if (was_ok)
                        SC_set_errornumber(self, STMT_OK);
                else if (was_fatal)
                        SC_set_errornumber(self,STMT_BAD_ERROR);

And STMT_BAD_ERROR is what returns 08S01 when I call SQLGetDiagRec.

I could really use some help with this...



-----Original Message-----
From:    Dave Page [mailto:dpage@vale-housing.co.uk]
Sent:    Wed 9/7/2005 9:02 AM
To:    Scot Loach; Anoop Kumar
Cc:    pgsql-odbc@postgresql.org
Subject:    RE: [ODBC] changed behavior in libpq odbc driver


> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 07 September 2005 13:48
> To: Dave Page; Anoop Kumar
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] changed behavior in libpq odbc driver
>
> so I'm definitely still able to reproduce this problem.
> The test I'm running is somewhat complex, I can work on
> simplifying it.
> Maybe the error code is left around from before and not
> properly cleared?

Well the only time the error code should be set is if libpq reports the
connection as being bad, so if you're definitely seeing it, it must be
coming from somewhere else, or you're not checking the error code when
it actually arrives.

Can you add a mylog line into the relevant part of the fix I posted so
youo can see if the error code is being set somewhen that you don't
otherwise notice?

Regards Dave