Re: Error handling in ODBC - Mailing list pgsql-odbc

From Tom Lane
Subject Re: Error handling in ODBC
Date
Msg-id 2372.992883373@sss.pgh.pa.us
Whole thread Raw
In response to RE: Error handling in ODBC  (Dave Page <dpage@vale-housing.co.uk>)
List pgsql-odbc
Dave Page <dpage@vale-housing.co.uk> writes:
> I noticed that in connection.c, CC_send_query loops waiting waiting for a
> message from the backend. If it is 'N' then the notice is raised as a
> PGRES_NONFATAL_ERROR, but, if it is a 'C', then another loop is entered
> processing messages until an 'I' is received. If an 'N' is received in this
> loop then is basically gets ignored as far as I can tell.

This all sounds very wrong.  Notices should be collected for display
somehow, but they should not affect the state of the query protocol
exchange --- ie, you should keep reading messages until you see a
termination condition ('Z' message, normally) regardless of notices.
Notices are not errors.

And you should definitely be prepared to accept multiple notices in
a query, and notices arriving at any time during a query.

            regards, tom lane

pgsql-odbc by date:

Previous
From: Kovacs Zoltan
Date:
Subject: Re: Error handling in ODBC
Next
From: "Marc Zandvliet"
Date:
Subject: Data Truncation Errors