BUG #13670: DST discrepancy between age() and subtraction for timestamptz arguments

From: jpruitt(at)doozer(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13670: DST discrepancy between age() and subtraction for timestamptz arguments
Date: 2015-10-08 22:34:05
Message-ID: 20151008223405.1223.38427@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13670
Logged by: John Pruitt
Email address: jpruitt(at)doozer(dot)com
PostgreSQL version: 9.4.4
Operating system: x86_64-apple-darwin
Description:

We are seeing a discrepancy between what is returned by the age(timestamptz,
timestamptz) function versus using the subtraction operator (timestamptz -
timestamptz) on the DST transition days. It appears that the subtraction
operator gives the correct answers, while the age function does not.

/* short day - 2:00 is skipped - 1 hour is correct */
select
'2015-03-08 03:00'::timestamptz - '2015-03-08 01:00'::timestamptz -- 1
hour
, age('2015-03-08 03:00'::timestamptz, '2015-03-08 01:00'::timestamptz) -- 2
hours
;

/* long day - 1:00 repeats - 3 hours is correct */
select
'2014-11-02 02:00'::timestamptz - '2014-11-02 00:00'::timestamptz -- 3
hours
, age('2014-11-02 02:00'::timestamptz, '2014-11-02 00:00'::timestamptz) -- 2
hours
;

The timezone setting in the database is 'America/Chicago' which is the same
setting in the operating system.

show timezone; -- 'America/Chicago'

version():

version
"PostgreSQL 9.4.4 on x86_64-apple-darwin, compiled by
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build
5658) (LLVM build 2336.11.00), 64-bit"

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2015-10-09 03:26:49 Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
Previous Message Bruce Momjian 2015-10-08 18:01:01 Re: BUG #13668: Production server Crash