pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tbrandys@webcellence.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14660: Conversion to UTC not properly computed
Date: Thu, 18 May 2017 16:09:16 +0000
Message-ID: <20170518160916.29053.46920@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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-18 08: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


view thread (3+ messages)  latest in thread

Message-ID: <20170518160916.29053.46920@wrigleys.postgresql.org>
Permalink:  ../20170518160916.29053.46920@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170518160916.29053.46920@wrigleys.postgresql.org

 · 

reply

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-bugs@postgresql.org
  Cc: tbrandys@webcellence.com
  Subject: Re: BUG #14660: Conversion to UTC not properly computed
  In-Reply-To: <20170518160916.29053.46920@wrigleys.postgresql.org>
  References: <20170518160916.29053.46920@wrigleys.postgresql.org>

* 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