Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-02 Thread Caleb Welton
On 10/1/09 9:26 PM, Robert Haas robertmh...@gmail.com wrote: 2009/10/1 KaiGai Kohei kai...@ak.jp.nec.com: Robert Haas wrote: On Thu, Oct 1, 2009 at 8:52 PM, Euler Taveira de Oliveira eu...@timbira.com wrote: David E. Wheeler escreveu: On Oct 1, 2009, at 3:42 PM, Tom Lane wrote: My

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-02 Thread Tom Lane
KaiGai Kohei kai...@ak.jp.nec.com writes: Robert Haas wrote: I disagree. I think David has this one right. I expect the results of CREATE OR REPLACE to be the same as the result of CREATE would have been had the object not existed. If so, it seems to me CREATE OR REPLACE is equivalent to a

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-02 Thread David E. Wheeler
On Oct 2, 2009, at 7:49 AM, Tom Lane wrote: But in fact CREATE OR REPLACE is *not* meant to be the same as DROP followed by CREATE. What it is meant to do is allow you to replace the implementation of the function while existing callers see it as still being the same function. Thus we

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-02 Thread Robert Haas
On Fri, Oct 2, 2009 at 10:25 AM, Caleb Welton cwel...@greenplum.com wrote: Right - so the subtle point here is that ALTER means something different from CREATE OR REPLACE.  ALTER means to make a modification to something; to change it; to adjust one particular property of the object without

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-02 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: Okay, this convinces me otherwise. But is it not in fact the case that CREATE OR REPLACE FUNCTION doesn't expire the old version of the function in the cache of other processes? It is not. Don't those processes have to reconnect in order

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-02 Thread David E. Wheeler
On Oct 2, 2009, at 8:49 AM, Tom Lane wrote: The ideal is that backends will start using the new function implementation on the next call after the REPLACE commits (but any evaluations already in progress must of course continue with the text they have). We have been gradually getting closer to

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-02 Thread Tom Lane
I wrote: Whichever way you think it should work, there's a bug here that goes back several versions, and I rather suspect we may have the same issue for other REPLACE-type commands ... BTW, I looked around for related problems and don't see any. We only have CREATE OR REPLACE for functions,

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-02 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: My inclination is to think that the right behavior for REPLACE FUNCTION is to keep the old proowner and proacl values, because that's what it always has done and nobody's complained. +1. Stephen signature.asc Description: Digital signature

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-02 Thread Pavel Stehule
2009/10/2 Stephen Frost sfr...@snowman.net: * Tom Lane (t...@sss.pgh.pa.us) wrote: My inclination is to think that the right behavior for REPLACE FUNCTION is to keep the old proowner and proacl values, because that's what it always has done and nobody's complained. +1. +1 Pavel        

[HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-01 Thread Tom Lane
Whilst fooling with the default ACLs patch I noticed that there's a pre-existing bug in CREATE OR REPLACE FUNCTION. It will let you replace a function if pg_proc_ownercheck passes, which these days does *not* mean that you are exactly the role mentioned in pg_proc.proowner; it only means you are

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-01 Thread David E. Wheeler
On Oct 1, 2009, at 3:42 PM, Tom Lane wrote: My inclination is to think that the right behavior for REPLACE FUNCTION is to keep the old proowner and proacl values, because that's what it always has done and nobody's complained. But I suppose a case could be made that you're completely

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-01 Thread Euler Taveira de Oliveira
David E. Wheeler escreveu: On Oct 1, 2009, at 3:42 PM, Tom Lane wrote: My inclination is to think that the right behavior for REPLACE FUNCTION is to keep the old proowner and proacl values, because that's what it always has done and nobody's complained. But I suppose a case could be made

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-01 Thread Robert Haas
On Thu, Oct 1, 2009 at 8:52 PM, Euler Taveira de Oliveira eu...@timbira.com wrote: David E. Wheeler escreveu: On Oct 1, 2009, at 3:42 PM, Tom Lane wrote: My inclination is to think that the right behavior for REPLACE FUNCTION is to keep the old proowner and proacl values, because that's what

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-01 Thread KaiGai Kohei
Robert Haas wrote: On Thu, Oct 1, 2009 at 8:52 PM, Euler Taveira de Oliveira eu...@timbira.com wrote: David E. Wheeler escreveu: On Oct 1, 2009, at 3:42 PM, Tom Lane wrote: My inclination is to think that the right behavior for REPLACE FUNCTION is to keep the old proowner and proacl values,

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-01 Thread Robert Haas
2009/10/1 KaiGai Kohei kai...@ak.jp.nec.com: Robert Haas wrote: On Thu, Oct 1, 2009 at 8:52 PM, Euler Taveira de Oliveira eu...@timbira.com wrote: David E. Wheeler escreveu: On Oct 1, 2009, at 3:42 PM, Tom Lane wrote: My inclination is to think that the right behavior for REPLACE FUNCTION

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-01 Thread KaiGai Kohei
Robert Haas wrote: 2009/10/1 KaiGai Kohei kai...@ak.jp.nec.com: Robert Haas wrote: On Thu, Oct 1, 2009 at 8:52 PM, Euler Taveira de Oliveira eu...@timbira.com wrote: David E. Wheeler escreveu: On Oct 1, 2009, at 3:42 PM, Tom Lane wrote: My inclination is to think that the right behavior

Re: [HACKERS] CREATE OR REPLACE FUNCTION vs ownership

2009-10-01 Thread Robert Haas
2009/10/1 KaiGai Kohei kai...@ak.jp.nec.com: Robert Haas wrote: 2009/10/1 KaiGai Kohei kai...@ak.jp.nec.com: Robert Haas wrote: On Thu, Oct 1, 2009 at 8:52 PM, Euler Taveira de Oliveira eu...@timbira.com wrote: David E. Wheeler escreveu: On Oct 1, 2009, at 3:42 PM, Tom Lane wrote: My