Re: `order by random()` makes select-list `random()` invocations deterministic

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Dian Fay <di(at)nmfay(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: `order by random()` makes select-list `random()` invocations deterministic
Date: 2024-02-29 05:53:09
Message-ID: CAKFQuwYo+EV4=o8Uc6wH=Ko+V8hgiqqOK=a9EC5G90HYx9+POw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wednesday, February 28, 2024, Dian Fay <di(at)nmfay(dot)com> wrote:
>
>
> Every `random()` invocation in the select list uses a single consistent
> value within each returned row. Remove the `order by random()` and
> values become randomized as expected, but it gets a bit stranger:
>
>
This seems to be one of those “won’t fix” bugs that stems from the parser
being a bit too liberal in what it accepts as valid SQL.

https://www.postgresql.org/message-id/CAKFQuwZ3-XGfcS%2BCLTAYvPx3ARYjUxv%2B%3DYL8sOicV0nda%3DT5cA%40mail.gmail.com

The fact that the gs involving expression is seen differently than the ones
not involving gs doesn’t surprise me.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message feichanghong 2024-02-29 06:21:58 Re:BUG #18371: There are wrong constraint residues when detach hash partiton concurrently
Previous Message Michael Paquier 2024-02-29 05:46:07 Re: BUG #18363: Assert !ReindexIsProcessingIndex falsified with expression index over select from table