Re: Not null constraint in postgre

Поиск
Список
Период
Сортировка
От Didier Gasser-Morlay
Тема Re: Not null constraint in postgre
Дата
Msg-id CAF5nyP9OXyk=7h-Vr_x_pT-09NDmeKcuYWSVWCPmXfR2FObb_g@mail.gmail.com
обсуждение исходный текст
Ответ на Not null constraint in postgre  (Chamath Sajeewa <csgsajeewa@gmail.com>)
Ответы Re: Not null constraint in postgre
Список pgsql-novice
In order to get the default value to kick in in an insert statement (which I assume you're trying to do), you can either omit that column name from the insert list or set that column value to DEFAULT (no quotes)

Didier

On Mon, 27 Jul 2020 at 07:45, Chamath Sajeewa <csgsajeewa@gmail.com> wrote:
Hi,
There is a column in my table with not null constraint. Default value is set to 0 for that column. In my query, column value is set to null. When i try to execute that query in pgsql, it is getting failed due to constraint violation. Any idea? This is working in oracle.
Thank You!

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

Предыдущее
От: Chamath Sajeewa
Дата:
Сообщение: Re: Not null constraint in postgre
Следующее
От: Chamath Sajeewa
Дата:
Сообщение: PGSQL equivalent to oracle DEFAULT ON NULL