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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix make_timestamp[tz] to accept negative years as meaning BC.
Дата
Msg-id E1kNJja-0004oI-8R@gemulon.postgresql.org
обсуждение исходный текст
Список 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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix memory leak in plpgsql's CALL processing.
Следующее
От: David Rowley
Дата:
Сообщение: pgsql: Doc: Improve clarity on partitioned table limitations