| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера