BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.

From: pietro(dot)pugni(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.
Date: 2017-04-26 18:23:22
Message-ID: 20170426182322.24371.95224@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: 14632
Logged by: Pietro Pugni
Email address: pietro(dot)pugni(at)gmail(dot)com
PostgreSQL version: 9.6.2
Operating system: Ubuntu 16.04.2 LTS
Description:

The following query:
SELECT '1912-02-29'::date + '10 years'::interval

returns:
'1922-02-28 00:00:00'

while the reverse operation:
SELECT '1922-02-28'::date - '10 years'::interval

returns:
'1912-02-28 00:00:00'

instead of '1912-02-29 00:00:00'.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2017-04-26 18:29:18 Re: BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.
Previous Message Andres Freund 2017-04-26 17:48:13 Re: Concurrent ALTER SEQUENCE RESTART Regression