public inbox for [email protected]
help / color / mirror / Atom feedFrom: PG Doc comments form <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Why 'infinity' is not in range '[2019-01-02, infinity]'?
Date: Mon, 29 Apr 2019 16:12:04 +0000
Message-ID: <[email protected]> (raw)
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/11/rangetypes.html
Description:
Hi.
May I read this:
But [today,infinity] means something different from [today,infinity) — the
latter excludes the special timestamp value infinity.
as
But [today,infinity] means something different from [today,infinity) — the
**first includes** the special timestamp value infinity.
But previous paragraph says:
But note that these infinite values are never values of the range's element
type, and can never be part of the range. (So there is no such thing as an
inclusive infinite bound — if you try to write one, it will automatically be
converted to an exclusive bound.)
if 'infinity' can not be the part of a range this will mean:
[today,infinity] means same as [today,infinity)
errr... which one is correct? Please fix documentation.
PS. The problem I am faced into:
I am implementing be-temporal interface. I have current period. It can be
[2019-01-01,2019-02-01),
[2019-02-01,2019-03-01) and [2019-03-01,infinity) for the current month.
When I setup current_period to one of those I will get Orders at that
period. The Orders have with 'last_bill_date' field which will show the date
of Invoice for that Order.
For new Order we can set 'infinity' into 'last_bill_date' which will mean
that we should create Invoice.
Now to select all Order for which we should create Invoice we can write:
select * from "order" o where o.last_bill_date +interval o.bill_interval <@
current_period();
This seems obvious that infinity is part of [value, infinity) ( or
[value,infinity] ) range. (in other words the 'infinity' is always the part
of range with infinite inclusive or exclusive bound.
This is just view from my point, there can be things that I am not aware of.
view thread (9+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox