Re: exception psycopg.Error from psycopg2 to psycopg 3

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: psycopg(at)lists(dot)postgresql(dot)org
Subject: Re: exception psycopg.Error from psycopg2 to psycopg 3
Date: 2022-02-12 09:39:44
Message-ID: YgeAYAZjgZVJGul/@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse psycopg by date

  From Date Subject
Next Message Paolo De Stefani 2022-03-18 23:56:28 Query with boolean parameter
Previous Message Paolo De Stefani 2022-02-11 19:42:34 Re: exception psycopg.Error from psycopg2 to psycopg 3