Re: Getting the SQLSTATE after a failed connection

2025-10-18 Thread Ranier Vilela
Hi. Em sex., 17 de out. de 2025 às 11:27, Daniele Varrazzo < [email protected]> escreveu: > Hello, > > in ticket an user > showed that, upon a failed connection attempt because of a bad > password, the server sends a SQLSTATE 28P01 message

Re: Getting the SQLSTATE after a failed connection

2025-10-17 Thread Daniele Varrazzo
On Fri, 17 Oct 2025 at 19:28, Ranier Vilela wrote: > Have you seen the *pgpassfileWarning* function > (src/interfaces/libpq/fe-connect.c)? > Does this sound like what you're looking for? Not at all, no -- Daniele

Re: Getting the SQLSTATE after a failed connection

2025-10-17 Thread Tom Lane
Daniele Varrazzo writes: > On Fri, 17 Oct 2025 at 16:49, Tom Lane wrote: >> I'd be in favor of adding some API here as long as it's not >> myopic about the complexity of the problem. > If the complexity comes from having to store a sqlstate for every > attempt, I'd like to point out that the mul

Re: Getting the SQLSTATE after a failed connection

2025-10-17 Thread Daniele Varrazzo
On Fri, 17 Oct 2025 at 16:49, Tom Lane wrote: > > Daniele Varrazzo 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-8

Re: Getting the SQLSTATE after a failed connection

2025-10-17 Thread Tom Lane
Daniele Varrazzo 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

Getting the SQLSTATE after a failed connection

2025-10-17 Thread Daniele Varrazzo
Hello, in ticket an user showed that, upon a failed connection attempt because of a bad password, the server sends a SQLSTATE 28P01 message. However psycopg cannot raise the expected `InvalidPassword` exception, because the only way to get the SQLST