pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #13608: 3 argument range constructor functions
2+ messages / 2 participants
[nested] [flat]

* BUG #13608: 3 argument range constructor functions
@ 2015-09-02 22:03  robert.kruus@gov.sk.ca
  0 siblings, 1 reply; 2+ messages in thread

From: robert.kruus@gov.sk.ca @ 2015-09-02 22:03 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      13608
Logged by:          Robert Kruus
Email address:      robert.kruus@gov.sk.ca
PostgreSQL version: 9.3.9
Operating system:   FreeBSD (9.2)
Description:        

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 works fine for numrange, tsrange, tstzrange.
i.e.
 SELECT numrange(1,4, '()');
 numrange
----------
 (1,4)

PostgreSQL 9.3.9 on amd64-portbld-freebsd9.2, compiled by FreeBSD clang
version 3.3 (tags/RELEASE_33/final 183502) 20130610, 64-bit


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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #13608: 3 argument range constructor functions
@ 2015-09-02 23:29  Tom Lane <tgl@sss.pgh.pa.us>
  parent: robert.kruus@gov.sk.ca
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2015-09-02 23:29 UTC (permalink / raw)
  To: robert.kruus@gov.sk.ca; +Cc: pgsql-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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-09-02 23:29 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-09-02 22:03 BUG #13608: 3 argument range constructor functions robert.kruus@gov.sk.ca
2015-09-02 23:29 ` Tom Lane <tgl@sss.pgh.pa.us>

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