tstzrange with ... 'infinity'] + upper_inf() using 9.2.4

From: Ralph Graulich <maillist(at)shauny(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: tstzrange with ... 'infinity'] + upper_inf() using 9.2.4
Date: 2013-05-01 21:53:22
Message-ID: 28E9F654-A6AE-4286-9FF5-7A997AA986BB@shauny.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

> select upper_inf(tsrange('2013-05-01'::timestamp, 'infinity'::timestamp, '[]'));
upper_inf
-----------
f
(1 row)

As far as I understood the docs, this query should return true, as the upper bound includes 'infinity'?

[http://www.postgresql.org/docs/9.2/interactive/functions-range.html]
"The lower and upper functions return null if the range is empty or the requested bound is infinite. The lower_inc, upper_inc, lower_inf, and upper_inf functions all return false for an empty range."

[http://www.postgresql.org/docs/9.2/interactive/rangetypes.html]
"Also, some element types have a notion of "infinity", but that is just another value so far as the range type mechanisms are concerned. For example, in timestamp ranges, [today,] means the same thing as [today,). But [today,infinity] means something different from [today,infinity) — the latter excludes the special timestamp value infinity.
The functions lower_inf and upper_inf test for infinite lower and upper bounds of a range, respectively."

Regards
Ralph

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-05-01 22:41:40 Re: tstzrange with ... 'infinity'] + upper_inf() using 9.2.4
Previous Message Merlin Moncure 2013-05-01 20:57:23 Re: Created a PostgreSQL test, what do you think?