On Wed, Jul 9, 2025 at 12:11 PM Tom Lane <t...@sss.pgh.pa.us> wrote:

> "David G. Johnston" <david.g.johns...@gmail.com> writes:
> > On Wed, Jul 9, 2025 at 9:15 AM Tom Lane <t...@sss.pgh.pa.us> wrote:
> >> TBH, I find this proposal to be useless nannyism.
>
> > Isn't preventing a dump-restore hazard sufficient reason to do this?
>
> No, I don't think so.  If you're not being very careful about revising
> functions used in indexes, you are going to have problems a lot sooner
> than some future dump/restore cycle.
>
>
Then probably this patch can just update the create index documentation to
say "create or replace it" instead of just "create it".  The fact that
during 'update' (replace) existing non-implied settings can be replaced
with implied ones is a beginner/inattentive foot-gun.  We do make the point
clearly in create function but it seems worthwhile to reinforce it here too.

"To use a user-defined function in an index expression or WHERE clause,
remember to mark the function immutable when you create [or replace] it."

David J.

Reply via email to