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@postgresql.org
Subject: pgsql: Make extract() do something more reasonable with infinite dateti
Date: Fri, 22 Jan 2016 03:26:27 +0000
Message-ID: <E1aMSMl-0007oF-8g@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1aMSMl-0007oF-8g@gemulon.postgresql.org>
Permalink:  ../E1aMSMl-0007oF-8g@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aMSMl-0007oF-8g@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: Make extract() do something more reasonable with infinite dateti
  In-Reply-To: <E1aMSMl-0007oF-8g@gemulon.postgresql.org>
  References: <E1aMSMl-0007oF-8g@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