Feature Request: ALTER FUNCTION (or something like that)

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Feature Request: ALTER FUNCTION (or something like that)
Дата
Msg-id Pine.LNX.4.21.0103271932430.30896-100000@olympus.scw.org
обсуждение исходный текст
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: IANA registration
Следующее
От: Mathijs Brands
Дата:
Сообщение: Re: Re: [BUGS] Tests randomly failed