Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-21 Thread Jim Nasby
On 11/21/14, 9:06 AM, Tom Lane wrote: Albe Laurenz writes: 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. I don't see any great attraction to th

Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-21 Thread Tom Lane
Albe Laurenz writes: > 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. I don't see any great attraction to that. regar

Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-21 Thread Albe Laurenz
Robert Haas wrote: > On Thu, Nov 20, 2014 at 1:56 PM, Albe Laurenz 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 i

Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-20 Thread Andrew Dunstan
On 11/20/2014 02:28 PM, Tom Lane wrote: Robert Haas writes: On Thu, Nov 20, 2014 at 1:56 PM, Albe Laurenz 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 hur

Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-20 Thread Tom Lane
Robert Haas writes: > On Thu, Nov 20, 2014 at 1:56 PM, Albe Laurenz 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

Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-20 Thread Robert Haas
On Thu, Nov 20, 2014 at 1:56 PM, Albe Laurenz 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 > prov

Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-20 Thread Albe Laurenz
Tom Lane wrote: > Antonin Houska writes: >> Albe Laurenz wrote: >>> 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 c

Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-19 Thread Tom Lane
Antonin Houska writes: > Albe Laurenz wrote: >> 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

Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-19 Thread Antonin Houska
Albe Laurenz wrote: > 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

Re: [HACKERS] Functions used in index definitions shouldn't be changed

2014-11-19 Thread Marko Tiikkaja
On 11/19/14 3:38 PM, Albe Laurenz wrote: 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

[HACKERS] Functions used in index definitions shouldn't be changed

2014-11-19 Thread Albe Laurenz
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