Re: libpq, connection error - question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David CARLIER <devnexen(at)gmail(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpq, connection error - question
Date: 2025-04-17 18:57:43
Message-ID: 2359907.1744916263@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

David CARLIER <devnexen(at)gmail(dot)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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Previous Message David CARLIER 2025-04-17 18:05:51 libpq, connection error - question