public inbox for [email protected]  
help / color / mirror / Atom feed
From: PetSerAl <[email protected]>
To: Han Tang <[email protected]>
Cc: [email protected]
Subject: Re: Postgresql range_agg() Return empty list
Date: Thu, 11 Jul 2024 18:02:03 +0300
Message-ID: <CAKygsHQFByAtLj7hq2D-e5vkm8gK=Yxsjx-LCXopA+Ovv7WOEg@mail.gmail.com> (raw)
In-Reply-To: <CAAqOU0s08dTFu0tQgEg=q+ifeU4aSYwxCG=ae229PrwwAea2mA@mail.gmail.com>
References: <CAAqOU0s08dTFu0tQgEg=q+ifeU4aSYwxCG=ae229PrwwAea2mA@mail.gmail.com>

Your update expression does not handle empty ranges properly, but
convert them into complete ranges.

https://dbfiddle.uk/Ia6wESpL

On Thu, Jul 11, 2024 at 5:55 PM Han Tang <[email protected]> wrote:
>
> Hi
>
> Hope you are doing well!
>
> I am using range_agg() function, it works fine with original table value
>
> Query Result
>
> But when I try to do some update for range value, it will give back an empty list
>
> Select range_agg(b.r)
> From (
>   Select int8range(lower(bin_range)+1, upper(bin_range)+5) as r
>   From bin_data) as b;
>
> Query Result
>
> I test with the same query in fiddle but no issue there
>
> https://dbfiddle.uk/1MRn8hn6
>
> All these query are running on pgAdmin4, wondering why it happens
>
> Thanks
> Han
>
>






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: Postgresql range_agg() Return empty list
  In-Reply-To: <CAKygsHQFByAtLj7hq2D-e5vkm8gK=Yxsjx-LCXopA+Ovv7WOEg@mail.gmail.com>

* 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