Re: TIMESTAMP WITHOUT TIME ZONE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Troy <rtroy(at)ScienceTools(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Randy Shelley <randy(dot)shelley(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: TIMESTAMP WITHOUT TIME ZONE
Date: 2006-12-15 22:35:15
Message-ID: 22158.1166222115@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Troy <rtroy(at)ScienceTools(dot)com> writes:
> That said, nobody has yet assured me that when I give a timestamp I get it
> back unmolested.

Well, as far as the backend is concerned you do get it back unmolested
(up to the limits of float roundoff error, if you use float timestamps):
* unconditionally for timestamp without timezone;
* if your TimeZone is the same as it was on insert, for timestamp
with timezone. (If you change the timezone setting you'll get a
suitably rotated value, and no that's not a bug.) Also you have
to be careful not to pass in a nonexistent or ambiguous value during
DST changes, else you might get an adjusted value back.

If you always run with TimeZone = GMT then there's effectively no
difference between timestamp with and without time zone.

Now the original context of this thread was what happens with the JDBC
driver, and that I'm not sure about --- they have a problem because they
have to map both types to the same Java type, and it doesn't fit real
well. But you'd be better off asking on pgsql-jdbc if you want the gory
details about that.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brandon Aiken 2006-12-15 22:54:27 Re: TIMESTAMP WITHOUT TIME ZONE
Previous Message Alvaro Herrera 2006-12-15 22:33:23 Re: TIMESTAMP WITHOUT TIME ZONE