From: Tim Cross <theophilusx@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Issue with timestamp without time zone datatype with default value as now()/localtimestamp
Date: Sat, 11 Jul 2020 10:49:22 +1000
Message-ID: <871rlikh9p.fsf@gmail.com> (raw)
In-Reply-To: <CADaTEeShceXK9CFifn3OzYUJQVfGqv3ab4d3fNkDpYvcUp_n3Q@mail.gmail.com>
References: <CADaTEeShceXK9CFifn3OzYUJQVfGqv3ab4d3fNkDpYvcUp_n3Q@mail.gmail.com>
Deepika S Gowda <deepika.gs@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: theophilusx@gmail.com
Subject: Re: Issue with timestamp without time zone datatype with default value as now()/localtimestamp
In-Reply-To: <871rlikh9p.fsf@gmail.com>
References: <CADaTEeShceXK9CFifn3OzYUJQVfGqv3ab4d3fNkDpYvcUp_n3Q@mail.gmail.com> <871rlikh9p.fsf@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox