From: | Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com> |
---|---|
To: | Martin Fischer <larivact(at)chello(dot)at> |
Cc: | "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org> |
Subject: | Re: psycopg2.Error.diag properties are None |
Date: | 2016-01-12 20:21:04 |
Message-ID: | CA+mi_8Y7OaHd7MpfOWW51+vZnS9+2zMx_krmYQTiFiL=O=-Nig@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | psycopg |
On Tue, Jan 12, 2016 at 8:13 PM, Martin Fischer <larivact(at)chello(dot)at> wrote:
> Hello folks,
>
> I tried to use psycopg2.Error.diag.column_name to get the column that caused
> an integrity error. I have got a NOT NULL column and if I insert NULL I of
> course get an error. But the diag.column_name of the error is None.
> Code I used: http://pastebin.com/raw/cQd670NK (users.prenames is NOT NULL in
> this case)
> Output I get:
> |ERROR
> None
> null value in column "prenames" violates not-null constraint
>
> I am using PostgreSQL 9.1.19 and psycopg2 2.6.1 (dt dec pq3 ext).
> Corresponding documentation:
> http://initd.org/psycopg/docs/module.html#psycopg2.Error.diag
PG_DIAG_COLUMN_NAME was introduced in PostgreSQL 9.3.
-- Daniele
From | Date | Subject | |
---|---|---|---|
Next Message | Karl O. Pinc | 2016-02-02 17:49:49 | A PGsendQuery API design for your review |
Previous Message | Martin Fischer | 2016-01-12 20:13:19 | psycopg2.Error.diag properties are None |