BUG #16923: Timestamptz always returns utc time when resultformat is in binary format.

Started by PG Bug reporting formabout 5 years ago3 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 16923
Logged by: Mark Ford
Email address: mjfshark@gmail.com
PostgreSQL version: 12.3
Operating system: Windows 10
Description:

Tested server version 12.3, client versions 10.13 (32bit and 64bit) and
13.2.(64bit)
Issue:
Using libpq.dll and requesting a result set in binary format. Timestamptz
results are returned in UTC timezone instead of the current session's
timezone setting. Note that in text format the timestamptz is returned
properly converted. Also note that Timetz results are converted correctly
regardless of the result set format (binary or text.)

Expected results:
The documentation seems to state that Timestamptz fields will be returned
converted to the currently set timezone session property and doesn't mention
the above behavior. This combined with timetz fields being converted
regardless of output format seems inconsistent.

Thank you.

#2Bruce Momjian
bruce@momjian.us
In reply to: PG Bug reporting form (#1)
Re: BUG #16923: Timestamptz always returns utc time when resultformat is in binary format.

On Thu, Mar 11, 2021 at 12:54:11PM +0000, PG Bug reporting form wrote:

The following bug has been logged on the website:

Bug reference: 16923
Logged by: Mark Ford
Email address: mjfshark@gmail.com
PostgreSQL version: 12.3
Operating system: Windows 10
Description:

Tested server version 12.3, client versions 10.13 (32bit and 64bit) and
13.2.(64bit)
Issue:
Using libpq.dll and requesting a result set in binary format. Timestamptz
results are returned in UTC timezone instead of the current session's
timezone setting. Note that in text format the timestamptz is returned
properly converted. Also note that Timetz results are converted correctly
regardless of the result set format (binary or text.)

Expected results:
The documentation seems to state that Timestamptz fields will be returned
converted to the currently set timezone session property and doesn't mention
the above behavior. This combined with timetz fields being converted
regardless of output format seems inconsistent.

I think you need to show us the commands you ran, and their output.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

The usefulness of a cup is in its emptiness, Bruce Lee

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: BUG #16923: Timestamptz always returns utc time when resultformat is in binary format.

PG Bug reporting form <noreply@postgresql.org> writes:

Using libpq.dll and requesting a result set in binary format. Timestamptz
results are returned in UTC timezone instead of the current session's
timezone setting. Note that in text format the timestamptz is returned
properly converted. Also note that Timetz results are converted correctly
regardless of the result set format (binary or text.)

A quick look at timestamptz_send and timetz_send shows that they both just
send the internal representation; there isn't any intent to do any sort
of timezone adjustment. Even if there were some reason to argue that this
is wrong, the behavior is of sufficiently long standing that I doubt we
could change it.

The documentation seems to state that Timestamptz fields will be returned
converted to the currently set timezone session property and doesn't mention
the above behavior.

Since, in general, we don't document binary representations in any detail,
I doubt that there is any such statement made intentionally. Text output
behaves that way, for sure, but if you see something claiming that it also
happens for binary output then we need to tweak the docs.

regards, tom lane