Re: PQresult() return value not very handy...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PQresult() return value not very handy...
Дата
Msg-id 28729.1024693454@sss.pgh.pa.us
обсуждение исходный текст
Ответ на PQresult() return value not very handy...  ("Peter de Vroomen" <peterv@geenspam_jaytown.com>)
Список pgsql-general
"Peter de Vroomen" <peterv@geenspam_jaytown.com> writes:
> It would have been better if PQresult() would return NULL when an error
> occurs and also return NULL when the field is NULL.

But field-is-NULL is not an error condition.

There's some merit in your suggestion, but it's not as obvious a win
as you seem to think.  The caller really needs to distinguish three
cases (error, NULL field value, normal case) and there's no clean
way to do so with only one return value.

> Any chance that this will be changed in the future?

Not much; it'd break too much existing code.  And PQgetisnull is not
so slow that anyone's going to get very excited about removing it
from the normal code path...

            regards, tom lane

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

Предыдущее
От: "Thomas F. O'Connell"
Дата:
Сообщение: comp.databases.postgresql.hackers
Следующее
От: Bill Moran
Дата:
Сообщение: Re: NetBSD Live CD/PostgreSQL?