pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: borratejaabhi@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16240: The now() function is populating different date time than expected
Date: Mon, 03 Feb 2020 09:24:50 -0500
Message-ID: <6199.1580739890@sss.pgh.pa.us> (raw)
In-Reply-To: <16240-81d13113beecf3cb@postgresql.org>
References: <16240-81d13113beecf3cb@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> We have certain columns in our database of data type 'timestamp with time
> zone'. We are populating them with now() function as default value
> .Sometimes the date time is getting populated as dates from 2017/18
> randomly. What can be the possible cause of this issue?

The most likely bet is that something is issuing insert commands with
non-default values in that column.  now() itself does basically nothing
except read the transaction start timestamp.  If you were seeing lots
of *other* weird time effects, like say timestamps in the postmaster
log jumping all over the place, maybe it'd be possible to believe that
there's something wrong with your server's system clock.  But I'd
start by looking more closely at your application's SQL logic.

			regards, tom lane





view thread (2+ messages)

Message-ID: <6199.1580739890@sss.pgh.pa.us>
Permalink:  ../6199.1580739890@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6199.1580739890@sss.pgh.pa.us

 · 

reply

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, borratejaabhi@gmail.com
  Subject: Re: BUG #16240: The now() function is populating different date time than expected
  In-Reply-To: <6199.1580739890@sss.pgh.pa.us>
  References: <16240-81d13113beecf3cb@postgresql.org> <6199.1580739890@sss.pgh.pa.us>

* 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