Re: timestamp default current_timestamp not working - Mailing list pgsql-general

From David G. Johnston
Subject Re: timestamp default current_timestamp not working
Date
Msg-id CAKFQuwan84V+C0OSVxjCxm-HpzpM1-YB5W2bqaviF-PSbG-SvA@mail.gmail.com
Whole thread Raw
In response to Re: timestamp default current_timestamp not working  (Sanjay Minni <sanjay.minni@gmail.com>)
List 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 by date:

Previous
From: Ron
Date:
Subject: Re: timestamp default current_timestamp not working
Next
From: Adrian Klaver
Date:
Subject: Re: timestamp default current_timestamp not working