From: Forest Wilkinson <lyris-pg@tibit.com>
To: pgsql-interfaces@postgresql.org
Subject: PGRES_FATAL_ERROR from queries in transaction abort state?
Date: Thu, 22 May 2003 13:58:10 -0700
Message-ID: <mldqcvkst5usunkue57995ls4cvr46q60b@4ax.com> (raw)
I am maintaining code that uses libpq, and takes PGRES_FATAL_ERROR to
mean the database connection can no longer be used. However, this
does not appear to be true in all cases. I have found that
PGRES_FATAL_ERROR is returned by all queries within a transaction
after any previous query fails. Unfortunately, I have no good way to
distinguish this situation (which merely requires a ROLLBACK) from an
actual fatal error. I don't want to parse the text from
PQresultErrorMessage(), because I don't believe it's guaranteed to
remain consistent between versions and locales. Is there another way
to tell the difference?
Why isn't PGRES_NONFATAL_ERROR returned for queries in an aborted
transaction state? PGRES_FATAL_ERROR seems like a lie, since the
error is not fatal.
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: lyris-pg@tibit.com
Subject: Re: PGRES_FATAL_ERROR from queries in transaction abort state?
In-Reply-To: <mldqcvkst5usunkue57995ls4cvr46q60b@4ax.com>
* 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