Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIosn-00072f-VY for psycopg@arkaria.postgresql.org; Sat, 12 Feb 2022 09:39:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nIosm-0001l0-3T for psycopg@arkaria.postgresql.org; Sat, 12 Feb 2022 09:39:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIosl-0001kr-S3 for psycopg@lists.postgresql.org; Sat, 12 Feb 2022 09:39:55 +0000 Received: from mout.gmx.net ([212.227.15.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIose-0006py-Uj for psycopg@lists.postgresql.org; Sat, 12 Feb 2022 09:39:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1644658786; bh=i99qqEHnYyhhh39Y+g8jNaLuMHo8AxL5eyPTRXswwdo=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=T5cNn+4U2Rn9Sxq9ej3sfGb2mIEJ6n45o+/flMBxsGbrQuHINrzsDDjoVrxBGQeYz Hv92SjW5RrA1H1PVvO826cVpBH3lU48tlCn+YxrBhZZjwC/eJuwghlLGJ/1J/YJiWF L39v7BV9XJ5Qjj8PvsTMRgkS7eQg4bBgYhftfN4k= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([84.190.228.74]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M59C2-1nHix33ktI-001CQt for ; Sat, 12 Feb 2022 10:39:46 +0100 Received: from ncq by hermes with local (Exim 4.94.2) (envelope-from ) id 1nIosa-0002RR-Jx for psycopg@lists.postgresql.org; Sat, 12 Feb 2022 10:39:44 +0100 Date: Sat, 12 Feb 2022 10:39:44 +0100 From: Karsten Hilbert To: psycopg@lists.postgresql.org Subject: Re: exception psycopg.Error from psycopg2 to psycopg 3 Message-ID: References: <11dedb1fce0dbbd6f125736347685fd5@paolodestefani.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) Sender: X-Provags-ID: V03:K1:2Z+MJHKFZjjc3jSnY5OWJZ3cGLg6np7uHPKtjh4Ftm9PWPeBUsX TpQfd1mEurzr2UhPy/U5llfpV5sl5a0ssqVrCwe2w63XzCpgN5wRW9U9pp4mx3/uepUwAYN /YBnxJmnbnw8O85JQvH8N1AQU/Lg+aP2/5nEbM676xDtI24HjWchvHEBzfEAlz2jofLc4NV E1HRXmDeTbr4cNUufPmSQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:gsFXg+qjzFs=:78IaIXaMF0bZKqFrPQPr8E V+vMIXnuFz0cBbKdaGlFB7iWEAFUaOQjhvg43719JTlwJF8F/IYxm4VIL11ZFMSFXiGM677uv 6qEohm/wYvpj6AwpRw5pd6F5LXRIRePyFnBpieiFUXx+awgic0tk3BWmCnein6RvQYHg6J2LJ JZaKP7PHwYSvIBvrlxEuoAHPXIC30uP+P5dFDD9Z0bhIhuPH/RHEOwiXAMEseu/5QJb6reaCJ cQ6bGEBaQ4WvyPZZ2YWRSestc7YcaQcix3AL8YXZaz6wskT3mRuzsMMLOixeUSHVNZ6e2WfYI urM7IsRYH8fHfILSlWb7qJSTJM7PSKgrPoMIQiu6oZRc7/VbTn/HjlVODI9kZm/y1iBTFXrnX dxGRZKfUjBWL/pWLoHazLAIgWJbPox0cX66Y1yWpHQrTqXR4X8hWcOwgwoyqqDyo2TlxqCPFR Xb5G+BgZuuytIOebu4iXYq7byejA3YpIrg6644Q9bxfUsLL6jSlVfaoi6Z0V6zfxZm6G1RAcB 1JMgxCcJLr8gNEjysHMxgqMW5uOTL7bfVZQAvmjhtWBOW/CZZ3N40N6ptWEULao34SDRV6wcm rDfwESdIh78ZUXkfIg8TUii8TM3j478R54DAurDYtg0c0iqnTysT7rOCXanGucptt/sMu44Qz 6hlVE769FaMzjSifFW0CS9peMk4E/fbqsgQcL+/n1BLjFlh+0z1FOipZO9YiqVlsIjycuwXuk azsCY6xiR4+k04u56cBYFZgAHz68QRFO5wwz1QaKr4rCpFVXaNurTg62xU91hXNaU16FeMkF+ jl7SXd1usWhWSNifzSLyRqpPbx8jjmuKodOhJD0oDiQQDS+owPqnX42A810U88HqoxGf5EC/X hPK2VN2/c3OgfjUX7bZvzuQsR7wlUD0KiWQaM162FBFcXDsjDdjPwfbe7yI1wAvuJUa5x8PGg 9IAreBMEnYxDHMdYdZ3TEk/EoDVu6mFSOl57Hg6SALWObEic2bdjGyGY+foxKc7cU6zLtlOlO KJQD4vV5mJh+oaK992O2n0rKbDyfajaytWquRpuD7K0GQ35deCG4hUa3wqMltNFSnhxkUaFxA FKDQPAb+yHySc8= Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Am Fri, Feb 11, 2022 at 07:47:22PM +0100 schrieb Daniele Varrazzo: > ISTM that setting e.sqlstate =3D 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.sql= state) > 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 =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B