Re: #PERSONAL# Reg: date going as 01/01/0001 - Mailing list pgsql-general

From John R Pierce
Subject Re: #PERSONAL# Reg: date going as 01/01/0001
Date
Msg-id 54F93790.20409@hogranch.com
Whole thread Raw
In response to #PERSONAL# Reg: date going as 01/01/0001  (Medhavi Mahansaria <medhavi.mahansaria@tcs.com>)
List pgsql-general
On 3/5/2015 8:34 PM, Medhavi Mahansaria wrote:
I need to enter the date in null column based on the results obtained.

but my date gets inserted as 01/01/0001 in postgresql 9.3 when there is no value.
I need to enter NULL in the column.

ummmmmm, it seems to work fine for me?    you give us no clue how you're inserting this date field.


test=# create table test (calendar date);
CREATE TABLE
test=# insert into test (calendar) values (null);
INSERT 0 1
test=# select calendar, calendar IS NULL from test;
 calendar | ?column?
----------+----------
          | t
(1 row)



-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast

pgsql-general by date:

Previous
From: Medhavi Mahansaria
Date:
Subject: #PERSONAL# Reg: date going as 01/01/0001
Next
From: Alan Nilsson
Date:
Subject: streaming replication across platforms