I wonder whether contain_volatile_functions_after_planning
and its sibling contain_mutable_functions_after_planning
shouldn't be documented to warn against this sort of misuse.

Ideally we'd not have them at all because of the TOCTOU hazard.
The remaining callers are in DDL callers like generated-column
creation and expression-index creation, where we basically just
have to trust that users won't redefine their functions later.
But we don't want developers putting such calls into places that
are any further upstream of execution than they have to be.

                        regards, tom lane


Reply via email to