Re: CREATE OR REPLACE FUNCTION vs ownership

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: CREATE OR REPLACE FUNCTION vs ownership
Date: 2009-10-02 00:57:18
Message-ID: 603c8f070910011757x22ebf5abh443872e1f81aeec2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 1, 2009 at 8:52 PM, Euler Taveira de Oliveira
<euler(at)timbira(dot)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 it
>>> always has done and nobody's complained.  But I suppose a case could
>>> be made that you're completely replacing the function and so you should
>>> replace its ownership/permissions too.  The CREATE FUNCTION reference
>>> page fails to specify either way, which is a documentation bug as well.
>>>
>>> Comments?
>>
>> The latter, I think. If I replace a function, I should be the new owner.
>> To me it makes no sense for someone else to own it.
>>
> Hmm... Using the same logic, if I add a new column should I be the table
> owner? If you're changing the function that is because you have permission.
>
> IMHO the owner should be preserved. In my mind, REPLACE is for changing the
> content and not the properties (name, owner, etc).

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.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-10-02 01:18:20 Re: Limit allocated memory per session
Previous Message Alvaro Herrera 2009-10-02 00:55:46 Re: Buffer usage in EXPLAIN and pg_stat_statements (review)