pgsql: Fix make_timestamp[tz] to accept negative years as meaning BC.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix make_timestamp[tz] to accept negative years as meaning BC.
Date: 2020-09-29 17:48:14
Message-ID: E1kNJja-0004oI-8R@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2020-09-30 00:02:52 pgsql: Doc: Improve clarity on partitioned table limitations
Previous Message Tom Lane 2020-09-29 15:18:47 pgsql: Fix memory leak in plpgsql's CALL processing.