Re: The jdbc and current_timestamp - Mailing list pgsql-general

From Tom Lane
Subject Re: The jdbc and current_timestamp
Date
Msg-id 9103.1169044731@sss.pgh.pa.us
Whole thread Raw
In response to Re: The jdbc and current_timestamp  (Richard Huxton <dev@archonet.com>)
Responses Re:   The jdbc
Re:   The jdbc
List pgsql-general
Richard Huxton <dev@archonet.com> writes:
> The time is fixed at the start of the transaction. This lets you do
> several inserts having the same timestamp.

I think there's another problem here, which is that he's declared
"currenttime" as a timestamp without time zone, but the
CURRENT_TIMESTAMP function yields timestamp with time zone,
meaning there's a TimeZone-dependent conversion going on.  It sounds
to me like there's a difference between the TimeZone setting between
his web app and his psql, leading to an hour's offset, plus a smaller
offset having to do with time-since-transaction-start.

> See here for details of timeofday() etc.
> http://www.postgresql.org/docs/8.2/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT

And read the preceding chapter's discussion of the different datetime
data types.

            regards, tom lane

pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Index bloat of 4x
Next
From: Tom Lane
Date:
Subject: Re: Controlling memory of session