meaning of PQresultStatus types

From: jois(dot)de(dot)vivre(at)gmail(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: meaning of PQresultStatus types
Date: 2006-05-23 18:30:44
Message-ID: 1148409044.765097.292940@g10g2000cwb.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm currently trying to understand how to deal with the return values
of PGresultStatus in terms of error handling in my application. The
postgres manual describes the return codes of PGresultStatus as:

PGRES_EMPTY_QUERY: The string sent to the server was empty.
PGRES_COMMAND_OK: Successful completion of a command returning no
data.
PGRES_TUPLES_OK: Successful completion of a command returning data.
PGRES_COPY_OUT: Copy Out (from server) data transfer started.
PGRES_COPY_IN: Copy In (to server) data transfer started.
PGRES_BAD_RESPONSE: The server's response was not understood.
PGRES_NONFATAL_ERROR: A nonfatal error (a notice or warning) occurred.
PGRES_FATAL_ERROR: A fatal error occurred.

My question is, what constitutes a PGRES_FATAL_ERROR or a
PGRES_BAD_RESPONSE?

I took PGRES_BAD_RESPONSE to mean that the libpq library was older than
the database being connected to and so the response was not being
handled properly.

I took PGRES_FATAL_ERROR to mean that critical system errors had
occurred (like running out of memory). While googling for more
information regarding this, I found people had said that this can be
generated for any queries that were executed after a failed query.
These posting were however very old and I didn't know if any of this
had been changed.

Could someone tell me where I can get more information regarding these
two particular error codes or confirm/deny my assumptions?

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jois.de.vivre 2006-05-23 18:36:18 Re: meaning of PQresultStatus types
Previous Message Jim C. Nasby 2006-05-23 18:08:47 Re: [GENERAL] autovacuum "connections" are hidden