X-Original-To: pgsql-interfaces@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 94E9992608D for ; Thu, 22 May 2003 22:22:30 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 84110-06 for ; Thu, 22 May 2003 22:21:58 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by developer.postgresql.org (Postfix) with ESMTP id 90667924CB4 for ; Thu, 22 May 2003 20:06:27 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h4N06RU6012312; Thu, 22 May 2003 20:06:27 -0400 (EDT) To: Forest Wilkinson Cc: pgsql-interfaces@postgresql.org Subject: Re: PGRES_FATAL_ERROR from queries in transaction abort state? In-reply-to: References: Comments: In-reply-to Forest Wilkinson message dated "Thu, 22 May 2003 13:58:10 -0700" Date: Thu, 22 May 2003 20:06:27 -0400 Message-ID: <12311.1053648387@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/50 X-Sequence-Number: 4168 Forest Wilkinson writes: > I am maintaining code that uses libpq, and takes PGRES_FATAL_ERROR to > mean the database connection can no longer be used. It has never meant that. Only connection status going to CONNECTION_BAD would mean that. > Why isn't PGRES_NONFATAL_ERROR returned for queries in an aborted > transaction state? I think that the original design intended the code PGRES_NONFATAL_ERROR to be used for what we now call a WARNING; but in point of fact it's not being used at all, because warnings aren't reported through PQresultStatus. AFAICS the *only* case where you get PGRES_NONFATAL_ERROR is when you pass a null PGresult pointer to PQresultStatus(), which in the current code is a pretty dubious choice (PGRES_EMPTY_QUERY is arguably better). regards, tom lane