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

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: John Pruitt <jpruitt(at)doozer(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13670: DST discrepancy between age() and subtraction for timestamptz arguments
Date: 2015-10-13 03:04:41
Message-ID: CAJrrPGdTdYuVthRFqRY3R+yWVg5twgrCyhokGQbGkJs1t8NM2g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Oct 13, 2015 at 1:50 AM, John Pruitt <jpruitt(at)doozer(dot)com> wrote:
> Okay, I'll acknowledge that the issue has been discussed before, however I
> fail to see how the issue can be considered resolved. The function takes
> time zone aware arguments, ignores that input, and returns plainly incorrect
> answers - the very definition of a bug.

I also feel like that it is a bug. Here I attached a patch that
corrects the problem.
The patch just adds the difference in DST to the hours of difference
between the two
timestamp. The drawback in this approach is that, it produces the result as
24:00:00 instead of 1 day.

Any better approach to handle this problem?

Regards,
Hari Babu
Fujitsu Australia

Attachment Content-Type Size
age_with_timestamptz_bug_fix.patch application/octet-stream 1002 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-10-13 03:49:46 Re: BUG #13670: DST discrepancy between age() and subtraction for timestamptz arguments
Previous Message Noah Misch 2015-10-13 02:08:31 Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')