Re: BUG #19944: Memoize caches volatile LATERAL scans across RTE_FUNCTION and RTE_VALUES, returning wrong results

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: 798604270(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19944: Memoize caches volatile LATERAL scans across RTE_FUNCTION and RTE_VALUES, returning wrong results
Date: 2026-12-01 00:07:21
Message-ID: CAGRkXqSw6tjNGvsV73YYSKkqH568fHZ4c=WYLQLWTFo9VUzKeg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Chi,

Thanks for the clear report. I can reproduce it, but I am leaning into this
is not
a bug.

We don't promise how many times a volatile function runs, and
David made that point about Memoize in [1]. Tom recently said similar
things about volatile functions in sub-selects [2] and in WHERE [3].

[1]
https://postgr.es/m/CAApHDvopmkAOecfQczbOvkVvo=OK89rABXujVYsFevsk77Dqdw@mail.gmail.com
[2] https://postgr.es/m/3410601.1794431320@sss.pgh.pa.us
[3] https://postgr.es/m/844264.1795464073@sss.pgh.pa.us

Thanks,
Shihao

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message shihao zhong 2026-12-01 00:11:54 Re: GiST: SERIALIZABLE misses conflict when scan prunes at internal page
Previous Message shihao zhong 2026-11-30 23:59:04 Re: BUG #19871: JSON_TABLE evaluates each PASSING argument once per column - a named variable $v gets different valu