Re: Support for %TYPE in CREATE FUNCTION

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Support for %TYPE in CREATE FUNCTION
Дата
Msg-id 22155.991240223@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Support for %TYPE in CREATE FUNCTION  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Support for %TYPE in CREATE FUNCTION
Re: Support for %TYPE in CREATE FUNCTION
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I think the major problem was that our pg_proc table doesn't have any
> way of handling arg changes.  In fact, we need a ALTER FUNCTION
> capability first so we can recreate functions in place with the same
> OID.

Actually that's the least of the issues.  The real problem is that
because of function overloading, myfunc(int4) and myfunc(int2) (for
example) are considered completely different functions.  It is thus
not at all clear what should happen if I create myfunc(foo.f1%TYPE)
and later alter the type of foo.f1 from int4 to int2.  Does myfunc(int4)
stop existing?  What if a conflicting myfunc(int2) already exists?
What happens to type-specific references to myfunc(int4) --- for
example, what if it's used as the implementation function for an
operator declared on int4?

Worrying about implementation issues is premature when you haven't
got an adequate definition.
        regards, tom lane


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Proceeding with gettext
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Support for %TYPE in CREATE FUNCTION