Re: SQLSTATE of notice PGresult

Поиск
Список
Период
Сортировка
От Euler Taveira de Oliveira
Тема Re: SQLSTATE of notice PGresult
Дата
Msg-id 4C74756A.5070703@timbira.com
обсуждение исходный текст
Ответ на Re: SQLSTATE of notice PGresult  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: SQLSTATE of notice PGresult  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas escreveu:
> On Fri, Aug 20, 2010 at 11:05 AM, Euler Taveira de Oliveira
> <euler@timbira.com> wrote:
>> Dmitriy Igrishin escreveu:
>>>   /* NOT presents - NULL. Why not "00000" ? */
>>>   const char* sqlstate = Pg::PQresultErrorField(res, PG_DIAG_SQLSTATE);
>>>
>> That's because the protocol doesn't set error field when the command
>> succeeded. IMHO it's an oversight (the documentation is correct but the code
>> is not) and should be correct because the spec enforces it.
> 
> Seems like a waste of bytes.
> 
Ugh? It is a matter of correctness. I'm not arguing in favor of it but if we
don't implement it, it is better document it. I don't actually rely on sql
state to check errors but can have applications out there that expect the spec
behavior but we don't provide it and, also fail to document it. Talking about
the patch, it is just pqSaveMessageField() calls in *Complete messages. I can
provide a patch for it.


--  Euler Taveira de Oliveira http://www.timbira.com/


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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: gSoC add MERGE command new patch -- merge_v104
Следующее
От: Robert Haas
Дата:
Сообщение: Re: SQLSTATE of notice PGresult