Re: Getting the SQLSTATE after a failed connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Getting the SQLSTATE after a failed connection
Date: 2025-10-17 14:49:28
Message-ID: 1679344.1760712568@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com> writes:
> Is there any way to get the last SQLSTATE from the connection object
> or is that information lost?

This was discussed just a few days ago:

https://www.postgresql.org/message-id/flat/125437e5-25c8-49ad-99af-8de04b77daf6%40postgrespro.ru

I'd be in favor of adding some API here as long as it's not
myopic about the complexity of the problem.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2025-10-17 15:04:42 Re: new environment variable INITDB_LOCALE_PROVIDER
Previous Message Tom Lane 2025-10-17 14:37:22 Re: Minor spelling fix in memnodes.h