| From: | PetSerAl <petseral(at)gmail(dot)com> |
|---|---|
| To: | Han Tang <bj(dot)tanghan(at)gmail(dot)com> |
| Cc: | pgsql-general(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Postgresql range_agg() Return empty list |
| Date: | 2024-07-11 15:02:03 |
| Message-ID: | CAKygsHQFByAtLj7hq2D-e5vkm8gK=Yxsjx-LCXopA+Ovv7WOEg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Your update expression does not handle empty ranges properly, but
convert them into complete ranges.
On Thu, Jul 11, 2024 at 5:55 PM Han Tang <bj(dot)tanghan(at)gmail(dot)com> 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
>
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Adrian Klaver | 2024-07-11 15:06:02 | Re: Running psql in a docker container |
| Previous Message | H | 2024-07-11 14:57:15 | Running psql in a docker container |