Re: Binary encoding of TIMESTAMP WITH TIME ZONE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Abbate <jma(at)freedomcircle(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Binary encoding of TIMESTAMP WITH TIME ZONE
Date: 2020-06-05 00:32:51
Message-ID: 1375425.1591317171@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joe Abbate <jma(at)freedomcircle(dot)com> writes:
> However, when using the same query using the Rust adapter the transition
> to a new row started showing up after midgnight GMT. I opened an issue
> on Github (https://github.com/sfackler/rust-postgres/issues/608 ) and
> the maintainer claimed the Rust adapter *had* to initialize timezone to
> UTC in order to properly convert "to and from time datatypes". I
> pointed out that the timezone offset is available in psql and psycopg2,
> but then he replied the binary encoding of timestamptz does *not*
> include the timezone offset.

Indeed it does not, just as the on-disk format for it does not. The
representation is effectively always in UTC. If you have some other
timezone setting selected, timestamptz_out rotates to that zone for
display purposes ... but the binary format doesn't.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Förster 2020-06-05 06:21:39 Re: PostgreSQL 11 with SSL on Linux
Previous Message Joe Abbate 2020-06-05 00:24:50 Binary encoding of TIMESTAMP WITH TIME ZONE