Re: PGRES_FATAL_ERROR from queries in transaction abort state?

From: Forest Wilkinson <lyris-pg(at)tibit(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: PGRES_FATAL_ERROR from queries in transaction abort state?
Date: 2003-05-23 00:23:45
Message-ID: otpqcvgqsa205b6gfut5mdivm08e5ttr78@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

>> 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.

Okay. What does it mean?

>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.

In that case, wouldn't PGRES_NONFATAL_ERROR be a more appropriate
choice for queries that fail due to an aborted transaction? I can't
think of how this condition could be considered fatal.

>AFAICS the *only* case where you get
>PGRES_NONFATAL_ERROR is when you pass a null PGresult pointer to
>PQresultStatus(),

I got one today by passing ";" to PQexec().

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message BTS 2003-05-23 06:55:07 PREPARE in ECPG
Previous Message Tom Lane 2003-05-23 00:06:27 Re: PGRES_FATAL_ERROR from queries in transaction abort state?