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
Yes perfect solution for me
Thank your the lightspeed response..
Il 11/02/2022 19:47 Daniele Varrazzo ha scritto:
On Fri, 11 Feb 2022 at 18:34, Paolo De Stefani
wrote:
Hi Paolo,
Yes, I can see some inconsistency there. At the moment I suggest you
use `e.diag.sqlstate`, which works as expecte
On Fri, 11 Feb 2022 at 19:47, Daniele Varrazzo
wrote:
> ISTM that setting e.sqlstate = e.diag.sqlstate would be an
> improvement.
https://github.com/psycopg/psycopg/issues/225
-- Daniele
On Fri, 11 Feb 2022 at 18:34, Paolo De Stefani wrote:
Hi Paolo,
Yes, I can see some inconsistency there. At the moment I suggest you
use `e.diag.sqlstate`, which works as expected and is available in
psycopg2 too.
In [8]: try: cnn.execute("""
...: do $$
...: begin
...: RAI