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

From Tom Lane
Subject Re: TIMESTAMP WITHOUT TIME ZONE
Date
Msg-id 22158.1166222115@sss.pgh.pa.us
Whole thread Raw
In response to Re: TIMESTAMP WITHOUT TIME ZONE  (Richard Troy <rtroy@ScienceTools.com>)
List pgsql-general
Richard Troy <rtroy@ScienceTools.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

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: TIMESTAMP WITHOUT TIME ZONE
Next
From: "Brandon Aiken"
Date:
Subject: Re: TIMESTAMP WITHOUT TIME ZONE