From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ruslan <ruslan@d19i00d0skgddi.cloudfront.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Binary encoding of timetz type
Date: Tue, 16 Mar 2021 15:00:55 -0400
Message-ID: <3388507.1615921255@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKPDVBptHtCQ3E7odM-NdAbV+E1eob=sV+s4632HahyPk700mQ@mail.gmail.com>
References: <CAKPDVBptHtCQ3E7odM-NdAbV+E1eob=sV+s4632HahyPk700mQ@mail.gmail.com>
Ruslan <ruslan@d19i00d0skgddi.cloudfront.net> writes:
> I wrote parser for COPY binary encoding. Everything is great but one thing
> worries me. It seems like the time offset field has reversed digit sign.
> I'm referring to this function
> https://github.com/postgres/postgres/blob/REL_13_STABLE/src/backend/utils/adt/date.c#L2150-L2159
Reversed compared to what? The code you quote is clearly sending the
internal representation as-is.
There's a lot of confusion in the world about whether positive timezone
offsets correspond to being east or west of Greenwich (not helped any
by the fact that there are relevant standards using both interpretations).
I think that our internal form uses positive-is-west, a/k/a POSIX rules,
but I'm too lazy to go check right now.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, ruslan@d19i00d0skgddi.cloudfront.net
Subject: Re: Binary encoding of timetz type
In-Reply-To: <3388507.1615921255@sss.pgh.pa.us>
References: <CAKPDVBptHtCQ3E7odM-NdAbV+E1eob=sV+s4632HahyPk700mQ@mail.gmail.com> <3388507.1615921255@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox