Feature Request: ALTER FUNCTION (or something like that) - Mailing list pgsql-hackers

From Joel Burton
Subject Feature Request: ALTER FUNCTION (or something like that)
Date
Msg-id Pine.LNX.4.21.0103271932430.30896-100000@olympus.scw.org
Whole thread Raw
Responses Re: Feature Request: ALTER FUNCTION (or something like that)  (Tom Lane <tgl@sss.pgh.pa.us>)
RE: Feature Request: ALTER FUNCTION (or something like that)  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
(I know that everyone is focusing on 7.1. This is a question about how
hard it would be to plan a feature for 7.2 or later)

One of the small annoyances in PG is that I use many functions to handle
small details, and these functions are called by views. If I want to
improve a function, I have to drop and recreate those views (and all views
that depend on them, etc.)

If I understand everything, this is because the function OID is used to
call the function, not its name.

How difficult would it be to either

. allow creation of a function using a specific OID? (CREATE FUNCTION
USING OID xxxxx ...)

or

. add a command like ALTER FUNCTION foo(text) TO foo(text) returns text as
....

Then, (presumably?) the calling functions and views could just find the
function by its old oid.

This would seem to require that the new function would take the same
parameters (and return the same?) as the old function. This could be
handled either as a runtime check by the ALTER command, or it could be
left as caveat functioner.

Perhaps this is tricky, or perhaps there's already a great solution. (If 
so, please tell!) If I'm making an idiot of myself, do let me know.

Otherwise, is this feasible? I could try my rusty hand at C, but I'd need
someone to give me a 2-paragraph game plan on where to start playing with
the code.

Thanks!


(of course, this raises the same question for VIEWs... dropping and
creating them is a pain b/c of the same reasons...)


-- 
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: IANA registration
Next
From: Mathijs Brands
Date:
Subject: Re: Re: [BUGS] Tests randomly failed