Re: timestamp default current_timestamp not working

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: timestamp default current_timestamp not working
Дата
Msg-id CAKFQuwan84V+C0OSVxjCxm-HpzpM1-YB5W2bqaviF-PSbG-SvA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: timestamp default current_timestamp not working  (Sanjay Minni <sanjay.minni@gmail.com>)
Список pgsql-general
On Tuesday, December 14, 2021, Sanjay Minni <sanjay.minni@gmail.com> wrote:
Its an insert and my insert SQL contains the column timestamp and value nil. 
Will it work if the SQL contains timestamp through value is nil


If you explicitly specify NULL for the value of the column then there is no need for the system to produce a default, and thus you will see NULL when you query that record.

You can say “DEFAULT” (no quotes) though if you need to have the column name in the Insert statement but still want the default to be used.

David J.

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

Предыдущее
От: Ron
Дата:
Сообщение: Re: timestamp default current_timestamp not working
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: timestamp default current_timestamp not working