Fwd: range_agg() missing support for multirange inputs

From: "Ian R(dot) Campbell" <ian(dot)campbell(at)thepathcentral(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Fwd: range_agg() missing support for multirange inputs
Date: 2021-12-07 12:51:45
Message-ID: CAOC8YUdFVtD-fc7WbPrbqyTVzGse+bhdBXLxPDRUFK-uxczAWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

*Moderator:* I have submitted this bug report twice, but it has never made
it onto the forum and I've never had feedback on it.

All my other reports have been rapidly responded to.

Please advise.

---------- Forwarded message ---------
From: Ian R. Campbell <ian(dot)campbell(at)thepathcentral(dot)com>
Date: Thu, 25 Nov 2021 at 00:13
Subject: range_agg() missing support for multirange inputs
To: <pgsql-bugs(at)lists(dot)postgresql(dot)org>

Consider the following code:

with a(x) as(

values

('{[10,20],[100,200]}'::int4multirange)

,('{[20,40],[15,55],[100,200]}'::int4multirange)

)

select range_agg(x)

from (

select unnest(x)x

from a

)t;

=> {[10,56),[100,201)}

Here, range_agg() won’t accept a multirange type input, but it outputs a
multirange type.

The only way to aggregate the source multirange rows is to unnest them
first.

However, range_intersect_agg() does not require the unnest step:

with a(x) as(

values

('{[10,20],[100,200]}'::int4multirange)

,('{[20,40],[15,55],[100,200]}'::int4multirange)

)

select range_intersect_agg(x)

from a;

=> {[15,21),[100,201)}

Ian Campbell

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitry Dolgov 2021-12-07 12:59:25 Re: BUG #17318: ERROR: AddressSanitizer: SEGV on unknown address in optimizer
Previous Message Francisco Olarte 2021-12-07 12:40:58 Re: When Update balloons memory