Re: Bug or strange result of Max() on arrays containing NULL values

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "Plettenbacher, Tobias (LWF)" <Tobias(dot)Plettenbacher(at)lwf(dot)bayern(dot)de>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Bug or strange result of Max() on arrays containing NULL values
Date: 2024-08-24 15:28:27
Message-ID: CAKFQuwaYG7BsqZh+jZVKwPVbE_xGUYOMCG9n_SpBTM3n2jiM8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Aug 24, 2024 at 5:54 AM Plettenbacher, Tobias (LWF) <
Tobias(dot)Plettenbacher(at)lwf(dot)bayern(dot)de> wrote:

> I often use Max(ARRAY[]) to get the ID of the maximum value.
>

You should probably start writing lateral queries with limits instead of
hacking aggregation to determine rank.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Maxim Boguk 2024-08-25 20:31:44 Re: BUG #18588: Cannot force/let database use parallel execution in simple case.
Previous Message Tom Lane 2024-08-24 14:54:48 Re: Bug or strange result of Max() on arrays containing NULL values