pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix EXTRACT(ISOYEAR FROM timestamp) for years BC.
Date: Thu, 12 Dec 2019 17:31:04 +0000
Message-ID: <E1ifSIq-00071D-U3@gemulon.postgresql.org> (raw)

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
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/332584da9cfdbe91a651427a9fc3ed76dffaa529

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(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1ifSIq-00071D-U3@gemulon.postgresql.org>
Permalink:  ../E1ifSIq-00071D-U3@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ifSIq-00071D-U3@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix EXTRACT(ISOYEAR FROM timestamp) for years BC.
  In-Reply-To: <E1ifSIq-00071D-U3@gemulon.postgresql.org>
  References: <E1ifSIq-00071D-U3@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox