From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix make_timestamp[tz] to accept negative years as meaning BC.
Date: Tue, 29 Sep 2020 17:48:14 +0000
Message-ID: <E1kNJja-0004oI-8R@gemulon.postgresql.org> (raw)
Fix make_timestamp[tz] to accept negative years as meaning BC.
Previously we threw an error. But make_date already allowed the case,
so it is inconsistent as well as unhelpful for make_timestamp not to.
Both functions continue to reject year zero.
Code and test fixes by Peter Eisentraut, doc changes by me
Discussion: https://postgr.es/m/13c0992c-f15a-a0ca-d839-91d3efd965d9@2ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a094c8ff53523e88ff9dd28ad467618039e27b58
Modified Files
--------------
doc/src/sgml/func.sgml | 12 ++++++++++--
src/backend/utils/adt/timestamp.c | 14 +++++++++-----
src/test/regress/expected/date.out | 2 ++
src/test/regress/expected/timestamp.out | 11 ++++++++++-
src/test/regress/sql/date.sql | 1 +
src/test/regress/sql/timestamp.sql | 5 ++++-
6 files changed, 36 insertions(+), 9 deletions(-)
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 make_timestamp[tz] to accept negative years as meaning BC.
In-Reply-To: <E1kNJja-0004oI-8R@gemulon.postgresql.org>
References: <E1kNJja-0004oI-8R@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