Public bug reported:

I am adding INTERVAL '1 day' to TIMESTAMP WITH TIME ZONE '2017-03-25
12:00 Europe/London'. This timestamp with chosen quite bloody mindedly
as the arithmetic crosses the DST boundary. (I am testing other software
that generates SQL).

Oracle, Vertica and Presto (with a pg back-end) all give a result of
13:00 on 26March; Raw Postgres give 12:00 on 26March,  i.e. it adds only
23 hours. Changing INTERVAL '1 day' to INTERVAL '24 hours' yields 13:00.


demo_db=> SELECT TIMESTAMP with time zone '2017-03-25 12:00:00 Europe/London' + 
interval '1 day' ;
        ?column?        
------------------------
 2017-03-26 12:00:00+01
(1 row)

demo_db=> SELECT TIMESTAMP with time zone '2017-03-25 12:00:00 Europe/London' + 
interval '24 hours' ;
        ?column?        
------------------------
 2017-03-26 13:00:00+01
(1 row)

PostgreSQL 9.5.5 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
6.2.0-5ubuntu12) 6.2.0 20161005, 64-bit

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: postgresql 9.5+176+git1
ProcVersionSignature: Ubuntu 4.8.0-34.36-generic 4.8.11
Uname: Linux 4.8.0-34-generic x86_64
ApportVersion: 2.20.3-0ubuntu8.2
Architecture: amd64
CurrentDesktop: XFCE
Date: Tue Jan 24 15:01:08 2017
InstallationDate: Installed on 2017-01-15 (9 days ago)
InstallationMedia: Xubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.2)
PackageArchitecture: all
SourcePackage: postgresql-common
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: postgresql-common (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug yakkety

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1659032

Title:
  timestamp+interval across a DST boundary gives erroneous result

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postgresql-common/+bug/1659032/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to