[BUGS] BUG #14660: Conversion to UTC not properly computed - Mailing list pgsql-bugs

From tbrandys@webcellence.com
Subject [BUGS] BUG #14660: Conversion to UTC not properly computed
Date
Msg-id 20170518160916.29053.46920@wrigleys.postgresql.org
Whole thread Raw
Responses Re: [BUGS] BUG #14660: Conversion to UTC not properly computed  (Marko Tiikkaja <marko@joh.to>)
Re: [BUGS] BUG #14660: Conversion to UTC not properly computed  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14660
Logged by:          Todd Brandys
Email address:      tbrandys@webcellence.com
PostgreSQL version: 9.6.3
Operating system:   Slackware Linux
Description:

According to
https://www.postgresql.org/docs/9.6/static/datatype-datetime.html

Conversions between timestamp without time zone and timestamp with time zone
normally assume that the timestamp without time zone value should be taken
or given as timezone local time. A different time zone can be specified for
the conversion using AT TIME ZONE.

With this in mind, the following output is troublesome:

vendita=# select now()::timestamp(0), now()::timestamp(0) with time zone,
timezone('utc', now()::timestamp(0)), timezone('utc', now()::timestamp(0)
with time zone);        now         |          now           |        timezone        |    timezone
---------------------+------------------------+------------------------+---------------------2017-05-18 08:55:10 |
2017-05-1808:55:10-07 | 2017-05-18 01:55:10-07 | 
2017-05-18 15:55:10
(1 row)

vendita=# show timezone; TimeZone
------------US/Arizona
(1 row)

The computation where the assumed use of the local time zone should occur is
incorrect (the third column).


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14659: "ERROR: could not open relation with OID" when creating table from SELECT with large row
Next
From: Marko Tiikkaja
Date:
Subject: Re: [BUGS] BUG #14660: Conversion to UTC not properly computed