Re: postgres source code function "internal_ping" may be not right in some conditions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: postgres source code function "internal_ping" may be not right in some conditions
Дата
Msg-id 17209.1490364163@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [GENERAL] postgres source code function "internal_ping" may be not right insome conditions  (lin <jluwln@163.com>)
Список pgsql-general
lin <jluwln@163.com> writes:
>  all.  I have test the function "internal_ping", and find in some conditions, the return result is not right.

> if conn->status == CONNECTION_BAD  ,  and the  "conn->last_sqlstate" is "28000", the return value is PQPING_OK, it is
notright. 

I don't think so.  28000 is ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION,
which is a not-unlikely case here since often a caller wouldn't have
bothered to provide a valid userid.  However, if the server returned that,
then it must be up; otherwise it could not have looked into pg_authid
to find out that the supplied userid wasn't valid.

IOW, the point of the ping functionality is to test whether the server
is up, not whether you have valid login credentials.

            regards, tom lane


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

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: Run statements before pg_dump in same transaction?
Следующее
От: Alexander Farber
Дата:
Сообщение: Combining INSERT with DELETE RETURNING