Re: BUG #19834: eager aggregation still evaluates volatile join clauses when the volatile function is inside a SubPl

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 303677365(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, Guofenglinux <guofenglinux(at)gmail(dot)com>
Subject: Re: BUG #19834: eager aggregation still evaluates volatile join clauses when the volatile function is inside a SubPl
Date: 2026-11-12 05:05:32
Message-ID: CAGRkXqR=VYW2hqTvfw17hfuW+o0jfhHxPV-tzTci9RXbdQv9qg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Tom,

> For example, these clauses behave quite differently:

If I understand correctly, you mean the following case,

A table t with 100 rows,

SELECT count(*) FROM t WHERE (SELECT random()) < 0.5;

returns either 100 or 0, because the sub-select runs only once.

I think technically that is one of the correct answers....It is just a
result the caller would almost never see otherwise.

I am okay to revert the patch..

Thanks,
Shihao

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2026-11-12 05:10:19 Re: BUG #19857: Stats restore rejects empty arrays, losing range and array stats
Previous Message Corey Huinker 2026-11-12 04:55:08 Re: BUG #19857: Stats restore rejects empty arrays, losing range and array stats