> On Mon, Mar 17, 2025 at 08:14:16PM GMT, Álvaro Herrera wrote: > On 2025-Mar-17, Álvaro Herrera wrote: > > > You can see my patch on top of yours here: > > https://github.com/alvherre/postgres/commits/query_id_squash_values/ > > and the CI run here: > > https://cirrus-ci.com/build/5660053472018432 > > Heh, this blew up on bogus SGML markup :-( Fixed and running again: > https://cirrus-ci.com/build/4822893680394240
Thanks, much appreciated! I've inspected the diff between patches and run few tests, at the first glance everything looks fine. > I am tempted to say that explicit casts should also be considered > squashable (that is, in IsSquashableConst() also allow the case of > func->funcformat == COERCE_EXPLICIT_CAST). Well, I admit I may have been burned too much by the initial reception of the patch and handled it too conservatively in this regard. Originally I also had a concern about normalized queries representation for explicit cast case, but it was resolved by Julien's suggestion to switch to the /* ... */ format. > 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) Agree, when put together with the OID limitation it doesn't look so bad. Somehow I was thinking about the Sami's proposal and the discussion in more abstract terms, as if we talk about any arbitrary mutable functions to squash -- I still would be cautious about hiding non-bootstrapped mutable functions.