On 2025-Mar-17, Dmitry Dolgov wrote: > I'm afraid there is a disagreement about this part of the feedback. I'm > not yet convinced about the idea suggested over there (treating mutable > functions in the same way as constants) and not planning to change > anything, at least not in the current version of the patch.
I have to admit that I am leaning towards removing the immutability constraint. The reason is that we already require the function to be boostrapped (due to the OID test) and to have implicit cast form, so that limits which functions are recognized; the only ones there that are not immutable are: castsource │ casttarget │ castfunc ─────────────────────────────┼──────────────────────────┼────────────────────────────────────────── text │ regclass │ regclass(text) character varying │ regclass │ regclass(text) date │ timestamp with time zone │ timestamptz(date) time without time zone │ time with time zone │ timetz(time without time zone) timestamp without time zone │ timestamp with time zone │ timestamptz(timestamp without time zone) Looking at this list, it seems rather random to me to say that we should not squash arrays with types using these casts. Should we really consider two queries to be different because they run with different search_path or TimeZone settings? But kindly do not submit a new version of the patch, as I already have some changes of my own (mostly on removing the term "merge" from code and comments to replace with "squash", as well as adding some more comments). I'll post it soon. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/