Re: Strange behavior with timestamptz

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "George Weaver" <georgew1(at)mts(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Strange behavior with timestamptz
Date: 2003-08-25 20:59:39
Message-ID: 10999.1061845179@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"George Weaver" <georgew1(at)mts(dot)net> writes:
> Does anyone have any idea why the default for seedlot recorded the time wit=
> h the day and month switched, resulting in the seedlot record being stamped=
> Nov 8, 2003 while the transaction was stamped correctly as Aug 11, 2003?

It's really not possible to believe that both of those were loaded from
the defaults you show. now() doesn't ever break down the system clock
value into day/month/year --- it just takes the system clock time in
seconds-since-epoch and adds a constant to get the right zero offset.
So there's no credible mechanism for now() to make such a mistake.

I think that your client software supplied a value for one field and
didn't supply a value for the other, and the supplied value was provided
in the wrong DateStyle.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joseph Shraibman 2003-08-26 00:58:29 How to join from two tables at once?
Previous Message George Weaver 2003-08-25 18:18:03 Strange behavior with timestamptz