Re: Issue with timestamp without time zone datatype with default value as now()/localtimestamp

From: Tim Cross <theophilusx(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Issue with timestamp without time zone datatype with default value as now()/localtimestamp
Date: 2020-07-11 00:49:22
Message-ID: 871rlikh9p.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Deepika S Gowda <deepika(dot)gs(at)gmail(dot)com> writes:

> Hi,
>
> On postgres 11.7 Master/Slave node, there is column named "createddate"
> with datatype "timestamp without time zone" with default value as "now()";
>
> Column Name | Date Type | Default value
> createddate |timestamp without time zone|Now()
>
>
> Issue: From the java application , data is getting loaded into this table
> where we expect column value should be today's date with timestamp(
> "2020-07-10 10:56:43.21"). But, out of 3K records, 100 records are loaded
> as "2019-07-10 10:56:43.21" (change in Year).
>
> What could be the issue? we tried changing the default value to
> "localtimestamp".
>

My bet would be you have some SQL statements which include a value for
'createddate', so the default is not being used.

--
Tim Cross

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ivan E. Panchenko 2020-07-11 07:20:40 Re: How to do phrase search?
Previous Message Paul Förster 2020-07-11 00:27:59 Re: Safe switchover