Re: BUG #5246: Misleading/inconsistent SQLSTATE behavior

Поиск
Список
Период
Сортировка
От Chris Travers
Тема Re: BUG #5246: Misleading/inconsistent SQLSTATE behavior
Дата
Msg-id 5ed37b140912161248r7d9e8afcgb2250ad8b148515b@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #5246: Misleading/inconsistent SQLSTATE behavior  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-bugs
On Wed, Dec 16, 2009 at 12:35 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> "Chris Travers" <chris.travers@gmail.com> wrote:
>
>> I am noticing that that a failed database connection results in an
>> unusable SQLSTATE in libpq, and a very different SQLSTATE than the
>> backend registers.
>
> Well, if the client fails to connect to the server, I'm not sure how
> the server could communicate its SQLSTATE to the client, in order to
> force them to match.

It does send an error message.  Currently I end up parsing that error
message and checking to see if a connection is active.  Unfortunately
this becomes annoying where the locale of the PostgreSQL instance
could change the messages received.

It would be nice to have at least an option for software to pick up a
code as to why a connection request fails instead of having to try to
deal with feedback intended for a human, but I would settle for at
least a SQLSTATE that indicated a connection problem instead of a
transaction issue (08001 or 08004) since these would be a lot less
ambiguous on the program interface side.

Best Wishes,
Chris Travers

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: BUG #5246: Misleading/inconsistent SQLSTATE behavior
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: pgstat wait timeout (by Robert Schnabel)