Re: range_agg - Mailing list pgsql-hackers

From Paul A Jungwirth
Subject Re: range_agg
Date
Msg-id CA+renyW9E4eCA0p6n6-LgPDzFmEp2asG0cg2USr8G2hL_iG5og@mail.gmail.com
Whole thread Raw
In response to Re: range_agg  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Tue, Jul 9, 2019 at 12:02 PM Jeff Davis <pgsql@j-davis.com> wrote:
> > - Multirange in/out work just like arrays, e.g. '{"[1,3)", "[5,6)"}'
>
> It would be cool to have a better text representation. We could go
> simple like:
>
>    '[1,3) [5,6)'

Will that work with all ranges, even user-defined ones? With a
tstzrange[] there is a lot of quoting:

=# select array[tstzrange(now(), now() + interval '1 hour')];
                                   array
---------------------------------------------------------------------------
 {"[\"2019-07-09 12:40:20.794054-07\",\"2019-07-09 13:40:20.794054-07\")"}

I'm more inclined to follow the array syntax both because it will be
familiar & consistent to users (no need to remember any differences)
and because it's already built so we can use it and know it won't have
gotchas.

> I think "complement" might be a better name than "inverse".
>
> m1 - m2 = m1 * complement(m2)
>
> What about "~"?

That seems like the right term and a good symbol.

Paul



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Remove page-read callback from XLogReaderState.
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: [HACKERS] WAL logging problem in 9.4.3?