X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2E7B5D90C5 for ; Thu, 15 Sep 2005 22:53:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94680-10 for ; Fri, 16 Sep 2005 01:53:18 +0000 (GMT) Received: from mailserver.sandvine.com (sandvine.com [199.243.201.138]) by svr1.postgresql.org (Postfix) with ESMTP id 2C30AD90C0 for ; Thu, 15 Sep 2005 22:53:19 -0300 (ADT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Subject: Re: changed behavior in libpq odbc driver Date: Thu, 15 Sep 2005 21:53:22 -0400 Message-ID: <71837C040963F748B9B94E123A2896785A108D@mailserver.sandvine.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ODBC] changed behavior in libpq odbc driver Thread-Index: AcWmX6B1ojlaWTubQf+Ja4Cwz8uchQAAVJfgAbnhinABfrcejwAOy5vQAAmdB8AAAHq5MAAAzEvwAAB7ceABrSzUhw== From: "Scot Loach" To: "Dave Page" , "Anoop Kumar" Cc: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/143 X-Sequence-Number: 6041 In LIBPQ_execute_query(): qres->status =3D 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) { =20 was_ok =3D QR_command_successful(res); was_nonfatal =3D QR_command_nonfatal(res); was_fatal =3D QR_command_fatal(res); =20 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 =20 > -----Original Message----- > From: Scot Loach [mailto:sloach@sandvine.com]=20 > 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 >=20 > so I'm definitely still able to reproduce this problem. > The test I'm running is somewhat complex, I can work on=20 > simplifying it. > Maybe the error code is left around from before and not=20 > 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.=20 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