pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Forest Wilkinson <lyris-pg@tibit.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: PGRES_FATAL_ERROR from queries in transaction abort state?
Date: Thu, 22 May 2003 20:06:27 -0400
Message-ID: <12311.1053648387@sss.pgh.pa.us> (raw)
In-Reply-To: <mldqcvkst5usunkue57995ls4cvr46q60b@4ax.com>
References: <mldqcvkst5usunkue57995ls4cvr46q60b@4ax.com>

Forest Wilkinson <lyris-pg@tibit.com> 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



view thread (3+ messages)  latest in thread

Message-ID: <12311.1053648387@sss.pgh.pa.us>
Permalink:  ../12311.1053648387@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12311.1053648387@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, lyris-pg@tibit.com
  Subject: Re: PGRES_FATAL_ERROR from queries in transaction abort state?
  In-Reply-To: <12311.1053648387@sss.pgh.pa.us>

* 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