pgsql: Make extract() do something more reasonable with infinite dateti - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Make extract() do something more reasonable with infinite dateti
Date
Msg-id E1aMSMl-0007oF-8g@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Make extract() do something more reasonable with infinite datetimes.

Historically, extract() just returned zero for any case involving an
infinite timestamp[tz] input; even cases in which the unit name was
invalid.  This is not very sensible.  Instead, return infinity or
-infinity as appropriate when the requested field is one that is
monotonically increasing (e.g, year, epoch), or NULL when it is not
(e.g., day, hour).  Also, throw the expected errors for bad unit names.

BACKWARDS INCOMPATIBLE CHANGE

Vitaly Burovoy, reviewed by Vik Fearing

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/647d87c56ab6da70adb753c08d7cdf7ee905ea8a

Modified Files
--------------
doc/src/sgml/func.sgml             |   11 ++
src/backend/utils/adt/timestamp.c  |  111 +++++++++++++++--
src/test/regress/expected/date.out |  242 ++++++++++++++++++++++++++++++++++++
src/test/regress/sql/date.sql      |   53 ++++++++
4 files changed, 405 insertions(+), 12 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Improve index AMs' opclass validation procedures.
Next
From: Tom Lane
Date:
Subject: pgsql: Remove new coupling between NAMEDATALEN and MAX_LEVENSHTEIN_STRL