Re: TIMESTAMP WITHOUT TIME ZONE - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: TIMESTAMP WITHOUT TIME ZONE
Date
Msg-id 20061215223322.GZ14237@alvh.no-ip.org
Whole thread Raw
In response to Re: TIMESTAMP WITHOUT TIME ZONE  (Richard Troy <rtroy@ScienceTools.com>)
List pgsql-general
Richard Troy wrote:

> I'd appreciate a clean yes/no;  From a Java application, throught PG in
> both directions, the same timestamp comes back that was handed to the JDBC
> driver so long as it's stored in a "timestamp without time zone"
> attribute, nomatter neither where on earth the insert/update originates,
> nor where the select originates? Same bits, yes? Otherwise, "Houston,
> we've got a problem."

If you pass a timestamp without time zone, the given timestamp will be
given back to you on request, no changes applied, whatever the timezone
either the inserter or the extracter are on.

If you pass a timestamp with time zone, the time will be rotated to UTC
on insert depending on the inserter's timezone (thus it's stored as
UTC), and will be rotated "back" to the extracter's timezone when you
extract it.  Note that both timezones may be different, so the numbers
you get may be different than the numbers you put in, but they will
signal exactly the same instant in time (in the appropriate time zone).

If you want to know what time zone the inserter used, you would store
that in a separate column.

pgsql-general by date:

Previous
From: Richard Troy
Date:
Subject: Re: TIMESTAMP WITHOUT TIME ZONE
Next
From: Tom Lane
Date:
Subject: Re: TIMESTAMP WITHOUT TIME ZONE