Re: daterange() is ignoring 3rd boundaries argument - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: daterange() is ignoring 3rd boundaries argument
Date
Msg-id CAKFQuwaT+c7J956RGmspTk+Cw5Ah_nuiftXZWhOLv3R-O97FjA@mail.gmail.com
Whole thread Raw
In response to daterange() is ignoring 3rd boundaries argument  (Robert KOFLER <rk@marksim.org>)
List pgsql-bugs
On Mon, Nov 28, 2022 at 5:16 PM Robert KOFLER <rk@marksim.org> wrote:
select daterange('2022-11-01'::date, '2023-01-31'::date, '()')
returns
[2022-11-02,2023-01-31) which is deafult of [)
instead of
(2022-11-02,2023-01-31)

You need to look at the boundary symbol AND the actual lower bound date.

Then read the following about discrete range types for what is happening here:

 
from manual: 8.17.6. Constructing Ranges and Multiranges

Yes, that tells you how to take "text" and turn it into a datum of type *range.  Is discusses input only, not output.  Output depends on the specific type and, as noted above, in particular whether it is discrete or continuous.

David J.

pgsql-bugs by date:

Previous
From: Richard Guo
Date:
Subject: Re: BUG #17700: An assert failed in prepjointree.c
Next
From: Tom Lane
Date:
Subject: Re: daterange() is ignoring 3rd boundaries argument