Re: exception psycopg.Error from psycopg2 to psycopg 3 - Mailing list psycopg

From Karsten Hilbert
Subject Re: exception psycopg.Error from psycopg2 to psycopg 3
Date
Msg-id YgeAYAZjgZVJGul/@hermes.hilbert.loc
Whole thread Raw
In response to Re: exception psycopg.Error from psycopg2 to psycopg 3  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
Am Fri, Feb 11, 2022 at 07:47:22PM +0100 schrieb Daniele Varrazzo:

> ISTM that setting e.sqlstate = e.diag.sqlstate would be an
> improvement. The docs describe indeed that sqlstate is expected to be
> None on the DBAPI classes
> (https://www.psycopg.org/psycopg3/docs/api/errors.html#psycopg.Error.sqlstate)
> but that wasn't written thinking about the inconsistency above. It
> makes more sense that Error.sqlstate is whatever state received, if
> any.
>
> Does it sound right?

+1

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B



psycopg by date:

Previous
From: Paolo De Stefani
Date:
Subject: Re: exception psycopg.Error from psycopg2 to psycopg 3
Next
From: Paolo De Stefani
Date:
Subject: Query with boolean parameter