Re: range_agg - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: range_agg
Date
Msg-id 2ab176f136f0fda560f63cd091875bf21c4fe7df.camel@j-davis.com
Whole thread Raw
In response to Re: range_agg  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-hackers
On Fri, 2019-07-05 at 10:57 -0700, Paul A Jungwirth wrote:
> I take it that a multirange contains of *disjoint* ranges, so instead
> of {[1,2), [2,3), [6,7)} you'd have {[1,3), [6,7)}. Jeff does that
> match your expectation?

Yes.

> I just realized that since weighted_range_agg and covering_range_agg
> return tuples of (anyrange, integer) (maybe other numeric types
> too?),
> their elements are *not ranges*, so they couldn't return a
> multirange.
> They would have to return an array of those tuples.

I think you are right. I was originally thinking a multirange and an
array of weights would work, but the multirange would coalesce adjacent
ranges because it would have no way to know they have different
weights.

Regards,
    Jeff Davis





pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: range_agg
Next
From: Justin Pryzby
Date:
Subject: Re: doc: improve PG 12 to_timestamp()/to_date() wording