pgsql: Fix EXTRACT(ISOYEAR FROM timestamp) for years BC. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix EXTRACT(ISOYEAR FROM timestamp) for years BC.
Date
Msg-id E1ifSIr-00071K-1H@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix EXTRACT(ISOYEAR FROM timestamp) for years BC.

The test cases added by commit 26ae3aa80 exposed an old oversight in
timestamp[tz]_part: they didn't correct the result of date2isoyear()
for BC years, so that we produced an off-by-one answer for such years.
Fix that, and back-patch to all supported branches.

Discussion: https://postgr.es/m/SG2PR06MB37762CAE45DB0F6CA7001EA9B6550@SG2PR06MB3776.apcprd06.prod.outlook.com

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6aa1263113a6aeeaf1a2405018bff50b4666134e

Modified Files
--------------
src/backend/utils/adt/timestamp.c         | 7 +++++++
src/test/regress/expected/timestamp.out   | 2 +-
src/test/regress/expected/timestamptz.out | 2 +-
3 files changed, 9 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix EXTRACT(ISOYEAR FROM timestamp) for years BC.
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Emit parameter values during query bind/execute errors