Re: libpq: How to get the error code after a failed PGconn connection
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: libpq: How to get the error code after a failed PGconn connection |
| Дата | |
| Msg-id | 28833.1398809892@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | libpq: How to get the error code after a failed PGconn connection (Hello World <worldanizer@gmail.com>) |
| Список | pgsql-hackers |
Hello World <worldanizer@gmail.com> writes:
> Given the following code.
> PGconn* const conn=PQconnectdbParams(keywords, values, false);
> if(! conn || PQstatus(conn)!=CONNECTION_OK){ /* error code? */ }
> - In case of a failed connection is there a way to get the error code to be
> able to distinguish between a (e.g.) bad password and the server being down.
1. This question is not really material for the -hackers list.
2. No, I'm afraid. libpq does not currently assign SQLSTATE error codes
to errors it detects internally, so even if there were an API for this,
it would fail to return anything in a lot of cases. Fixing that is on
the TODO list, but it's been there for a long time, so don't hold your
breath ...
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера