Re: Why would query return PGRES_NONFATAL_ERROR?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why would query return PGRES_NONFATAL_ERROR?
Дата
Msg-id 27233.1081533194@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why would query return PGRES_NONFATAL_ERROR?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Why would query return PGRES_NONFATAL_ERROR?  (Scott Ribe <scott_ribe@killerbytes.com>)
Список pgsql-general
I said:
> Hmm ... PGRES_NONFATAL_ERROR is only used for reporting NOTICE messages
> coming from the backend, and AFAICS such a result should never be
> returned out of PQexec; it's only passed to the notice-message receiver.

Wait, forget that; it's based on looking at CVS tip code :-(

In 7.3 there is only one use of PGRES_NONFATAL_ERROR, and it's this:

ExecStatusType
PQresultStatus(const PGresult *res)
{
    if (!res)
        return PGRES_NONFATAL_ERROR;
    return res->resultStatus;
}

So what you're seeing is a NULL PGresult pointer.  (7.4 uses
PGRES_FATAL_ERROR for this case, which I think is saner.)

The most likely causes for a NULL result from PQexec would be
out-of-memory or failure to send the query due to communication
failure.  Although PQresultErrorMessage can tell you nothing
(since there is no result), you should find something informative
in the connection's error status (PQerrorMessage).

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Why would query return PGRES_NONFATAL_ERROR?
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: Why would query return PGRES_NONFATAL_ERROR?