psycopg2.Error.diag properties are None

Поиск
Список
Период
Сортировка
От Martin Fischer
Тема psycopg2.Error.diag properties are None
Дата
Msg-id 56955E5F.9000404@chello.at
обсуждение исходный текст
Ответы Re: psycopg2.Error.diag properties are None  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список psycopg
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

I would appreciate some help.

Thanks,
Martin
|


В списке psycopg по дате отправления:

Предыдущее
От: Dan Sawyer
Дата:
Сообщение: Re: psycopg2 open file for reading
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: psycopg2.Error.diag properties are None