Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



lin <jluwln@xxxxxxx> 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 not right.

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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux