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

From Adrian Klaver
Subject Re: timestamp default current_timestamp not working
Date
Msg-id ee3549e8-5bf7-9187-5732-5ef1ba739f01@aklaver.com
Whole thread Raw
In response to Re: timestamp default current_timestamp not working  (Sanjay Minni <sanjay.minni@gmail.com>)
List pgsql-general
On 12/14/21 08:00, Sanjay Minni 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
No nil(NULL) is a valid value for the field as you have not specified 
NOT NULL on the column. If you do add that constraint you will get an 
error with your inserts. If you want the DEFAULT to work you will need 
to not include the "timestamp"(FYI, not a good choice for a name) field 
in the INSERT.


> 
> On Tue, 14 Dec, 2021, 9:20 pm Adrian Klaver, <adrian.klaver@aklaver.com 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: timestamp default current_timestamp not working
Next
From: Klaudie Willis
Date:
Subject: Re: When Update balloons memory