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
Hi all
Porting my program from psycopg2 to psycopg 3 i found another different
behaviour
This SQL code inside a function:
RAISE EXCEPTION 'Error wrong database' USING HINT = 'You need to use a
different database', ERRCODE = 'PA002';
is catched in python code with:
try:
except psycopg.