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

From Albe Laurenz
Subject Re: Functions used in index definitions shouldn't be changed
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17DA379F@ntex2010a.host.magwien.gv.at
Whole thread Raw
In response to Re: Functions used in index definitions shouldn't be changed  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Functions used in index definitions shouldn't be changed  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Robert Haas wrote:
> On Thu, Nov 20, 2014 at 1:56 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
> > I don't think that there is a universally compelling right or wrong to
> > questions like this, it is more a matter of taste.  Is it more important to protect
> > the casual DBA from hurting himself or herself, or is it more important to
> > provide a well honed scalpel for the experienced surgeon?
> 
> +1.
> 
> I think if we had an already-existing prohibition here and you
> proposed relaxing it, the howls would be equally loud.  We're not
> entirely consistent about how picky we are.

There is also the possibility to add syntax like this:

CREATE OR REPLACE [FORCE] FUNCTION ...

What do you think about that?  It would protect the casual user but allow
the expert to do it anyway.

Another thing I thought about is changing function volatility:
If you change the volatility of a function used in an index to anything
other than IMMUTABLE, your database will continue to work as expected, but
a dump will fail to restore with
ERROR:  functions in index expression must be marked IMMUTABLE

Is that something worth checking for?

Yours,
Laurenz Albe

pgsql-hackers by date:

Previous
From: Dag-Erling Smørgrav
Date:
Subject: Re: [PATCH] add ssl_protocols configuration option
Next
From: Alex Shulgin
Date:
Subject: Re: [PATCH] add ssl_protocols configuration option