Re: Feature Request: ALTER FUNCTION (or something like that)

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Re: Feature Request: ALTER FUNCTION (or something like that)
Дата
Msg-id Pine.LNX.4.21.0103272248240.717-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)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, 27 Mar 2001, Tom Lane wrote:

> Joel Burton <jburton@scw.org> writes:
> > . add a command like ALTER FUNCTION foo(text) TO foo(text) returns text as
> > ....
> 
> This is on the TODO list already, I believe.

Yikes. I should have read it more carefully. My apologies. There are so
many good things on it. Sadly, no one has claimed this item.

(I still didn't see ALTER VIEW, though, which would seem just as nice.)

> > This would seem to require that the new function would take the same
> > parameters (and return the same?) as the old function.
> 
> If it doesn't take the same parameters then it's not the same function
> at all, so that part is a nonissue.  We'd have to disallow change of
> return type as well.
> 
> > Perhaps this is tricky,
> 
> Updating pg_proc wouldn't be hard.  What's missing is a notification
> mechanism that would cause cached copies of the function to get
> replaced.  A crude first cut could just ignore that issue and still be
> extremely useful for development ...

A crude first cut would be useful for development... even if I had to
restart postmaster, it's still much easier than dumping/restoring the
whole database, which is the usual solution around here (trying to
individually fix each view/table using the function becomes so tricky as
one has to track every dependency after that, etc.) Dumping/restoring can
be great (three cheers especially for the new formats using the -F
switch!), but in the past, I've had one or two complicated views that
would dump, but couldn't be restored from the dump. (As was discussed
at the time in the list; the culprit was that pg_dump produced a
deeply complex expresion with a bazillion nested parentheses; if one
removed some of these, pg_restore did just fine.) This has disappeared
in the 7.1 code, but I'm still slightly skitting about the dump-restore so
very frequently cycle.

If I have your ear on the subject, tgl, is there any ugly-but-working hack
to update the function by modifying the system tables directly?

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Mark Knox"
Дата:
Сообщение: Re: Re: Call for platforms
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: RE: Feature Request: ALTER FUNCTION (or something like that)