From: Tom Lane <tgl@sss.pgh.pa.us>
To: robert.kruus@gov.sk.ca
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13608: 3 argument range constructor functions
Date: Wed, 02 Sep 2015 19:29:09 -0400
Message-ID: <21535.1441236549@sss.pgh.pa.us> (raw)
In-Reply-To: <20150902220316.1354.64214@wrigleys.postgresql.org>
References: <20150902220316.1354.64214@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
robert.kruus@gov.sk.ca writes:
> The int4range, int8range, daterange functions seem to be ignoring the 3rd
> argument which specifies the interval bounds.
> i.e.
> SELECT daterange('2010-01-01'::date, '2011-01-01'::date, '()'::text);
> daterange
> -------------------------
> [2010-01-02,2011-01-02)
It's not ignoring it. What it's doing is canonicalizing the range so that
equivalent ranges actually look the same. Note your bounds have changed.
(BTW, you misquoted the result; the upper date does not change in this
case, at least not for me.)
See the discussion of discrete vs continuous range types at
http://www.postgresql.org/docs/9.3/static/rangetypes.html#RANGETYPES-DISCRETE
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, robert.kruus@gov.sk.ca
Subject: Re: BUG #13608: 3 argument range constructor functions
In-Reply-To: <21535.1441236549@sss.pgh.pa.us>
References: <20150902220316.1354.64214@wrigleys.postgresql.org> <21535.1441236549@sss.pgh.pa.us>
* 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