Thread: libpq, connection error - question

libpq, connection error - question

From
David CARLIER
Date:
Hi,

in case of PQconnectdb call failure, is it possible to get SQLstate code such as 28P01 and if yes in which circumstance(s) ? I can t seem to get it from PQerrorMessage.

Thanks in advance.

Re: libpq, connection error - question

From
Tom Lane
Date:
David CARLIER <devnexen@gmail.com> writes:
> in case of PQconnectdb call failure, is it possible to get SQLstate code
> such as 28P01 and if yes in which circumstance(s) ? I can t seem to get it
> from PQerrorMessage.

No, libpq generally doesn't assign SQLSTATE codes to errors generated
within libpq.  (Adding that has been on the TODO list for a long time,
but apparently few people care.)

            regards, tom lane