Functions used in index definitions shouldn't be changed - Mailing list pgsql-hackers

From Albe Laurenz
Subject Functions used in index definitions shouldn't be changed
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17D9FF61@ntex2010a.host.magwien.gv.at
Whole thread Raw
Responses Re: Functions used in index definitions shouldn't be changed  (Marko Tiikkaja <marko@joh.to>)
Re: Functions used in index definitions shouldn't be changed  (Antonin Houska <ah@cybertec.at>)
List pgsql-hackers
Currently it is possible to change the behaviour of a function with
CREATE OR REPLACE FUNCTION even if the function is part of an index definition.

I think that should be forbidden, because it is very likely to corrupt
the index.  I expect the objection that this would break valid use cases
where people know exactly what they are doing, but I believe that this
is a footgun for inexperienced users that should be disarmed.

I'd also opt for forbidding behaviour changing modifications with ALTER FUNCTION
for functions used in index definitions, specifically altering strictness.

Attached is a patch implementing a fix.

Yours,
Laurenz Albe

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Increasing test coverage of WAL redo functions
Next
From: Andres Freund
Date:
Subject: Re: Increasing test coverage of WAL redo functions