Re: CREATE OR REPLACE FUNCTION vs ownership - Mailing list pgsql-hackers

From Robert Haas
Subject Re: CREATE OR REPLACE FUNCTION vs ownership
Date
Msg-id 603c8f070910020838u20a58998o33792a8b374dd729@mail.gmail.com
Whole thread Raw
In response to Re: CREATE OR REPLACE FUNCTION vs ownership  (Caleb Welton <cwelton@greenplum.com>)
List pgsql-hackers
On Fri, Oct 2, 2009 at 10:25 AM, Caleb Welton <cwelton@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 disturbing the others.  On the other
> hand, "REPLACE" means to get rid of something and replace it with an
> entirely new thing.  I think that is exactly why we have ALTER TABLE
> but CREATE OR REPLACE FUNCTION.
>
> Now, if we want to have an ALTER FUNCTION that replaces the function
> definition and leaves the owner intact - fine!  But that is not what
> REPLACE means.
>
> By this argument CREATE OR REPLACE FUNCTION should be able to change the
> return type of the function; which it can't.

No, because when we REPLACE we (rightly) prohibit a replacement that
is incompatible with the existing uses of the function.

...Robert


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: CREATE OR REPLACE FUNCTION vs ownership
Next
From: "David E. Wheeler"
Date:
Subject: Re: latest hstore patch