Re: ALTER FUNCTION / STRICT - Mailing list pgsql-patches

From Tom Lane
Subject Re: ALTER FUNCTION / STRICT
Date
Msg-id 25542.1110645340@sss.pgh.pa.us
Whole thread Raw
In response to ALTER FUNCTION / STRICT  (Neil Conway <neilc@samurai.com>)
Responses Re: ALTER FUNCTION / STRICT  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> This patch allows ALTER FUNCTION set change a function's strictness. In
> and of itself this isn't very useful, but it is defined in SQL2003, so
> it's probably worth implementing.

You realize of course that that can already be done with CREATE OR
REPLACE FUNCTION.  I think it's probably still somewhat useful to have
an ALTER, since the REPLACE way requires re-entering the whole function
body, which you very possibly don't want to change.

> - I considered making it possible to change other attributes of a
> function (e.g. volatility and security definer), and the patch is
> implemented such that this should be easy to do. Does anyone think this
> is worth doing?

Yes, on the same grounds as above.

> - SQL also specifies that the LANGUAGE clause of the function definition
> should be modifiable, but that strikes me as quite bizarre.

Indeed.  It doesn't seem sensible to change LANGUAGE without supplying a
new function body, and so I would argue that this should be left to
CREATE OR REPLACE FUNCTION.  But I can see wishing that I could change
the auxiliary properties of a function without retyping the body.

> Incidentally, is there a reason that DROP FUNCTION doesn't use the
> FuncWithArgs node?

Probably just historical, but why bother changing it?  I don't think
that would let you accomplish anything useful, like consolidating
RemoveFuncStmt with something else.  Nor would it make the code
measurably clearer IMHO.

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: Display Pg buffer cache (WIP)
Next
From: Marko Kreen
Date:
Subject: Re: pgcrypto: openssl digest fix