pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #12046: lower_inf('(-infinity,today)'::tsrange) returns false
2+ messages / 2 participants
[nested] [flat]

* BUG #12046: lower_inf('(-infinity,today)'::tsrange) returns false
@ 2014-11-24 11:34  presnypreklad@gmail.com
  0 siblings, 1 reply; 2+ messages in thread

From: presnypreklad@gmail.com @ 2014-11-24 11:34 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      12046
Logged by:          Nathan Cutler
Email address:      presnypreklad@gmail.com
PostgreSQL version: 9.3.5
Operating system:   openSUSE 13.2
Description:        

In the course of writing a program that accepts tsrange literals from the
user, which are then plugged into various SQL queries, today I was testing
some tsranges to see how they are interpreted by PostgreSQL 9.3.5.

This one, in particular, behaves strangely: '(-infinity,today)'::tsrange

The lower_inf function says the lower bound is not infinite (!)

test=> SELECT lower_inf('(-infinity,today)'::tsrange);
 lower_inf
-----------
 f
(1 row)

Yet PostgreSQL reports that this tsrange contains a timestamp like
'1000-01-01 BC' . . .

test=> SELECT '(-infinity,today)'::tsrange @> '1000-01-01 BC'::timestamp;
 ?column? 
----------
 t
(1 row)

Seems like a bug?


-- 
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 #12046: lower_inf('(-infinity, today)'::tsrange) returns false
@ 2014-11-24 18:57  Tom Lane <tgl@sss.pgh.pa.us>
  parent: presnypreklad@gmail.com
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2014-11-24 18:57 UTC (permalink / raw)
  To: presnypreklad@gmail.com; +Cc: pgsql-bugs

presnypreklad@gmail.com writes:
> In the course of writing a program that accepts tsrange literals from the
> user, which are then plugged into various SQL queries, today I was testing
> some tsranges to see how they are interpreted by PostgreSQL 9.3.5.

> This one, in particular, behaves strangely: '(-infinity,today)'::tsrange

> The lower_inf function says the lower bound is not infinite (!)

This is not surprising: the range stuff has its own notion of "infinite
bounds", which has nothing to do with any infinity concept that the
underlying datatype may or may not have.  Trying to unify those concepts
would greatly complicate the interface between ranges and their component
datatypes, without actually buying very much AFAICS.

			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:[~2014-11-24 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-11-24 11:34 BUG #12046: lower_inf('(-infinity,today)'::tsrange) returns false presnypreklad@gmail.com
2014-11-24 18:57 ` Re: BUG #12046: lower_inf('(-infinity, today)'::tsrange) returns false 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