Re: Support for %TYPE in CREATE FUNCTION

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Ian Lance Taylor <ian(at)airs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Support for %TYPE in CREATE FUNCTION
Date: 2001-05-30 16:30:23
Message-ID: 22155.991240223@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-05-30 16:32:33 Re: Proceeding with gettext
Previous Message Bruce Momjian 2001-05-30 16:18:33 Re: Patch for multi-key GiST

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-05-30 16:35:41 Re: getDate() and getTime() fails with columns of type 'TimeStamp'
Previous Message Tom Lane 2001-05-30 16:23:09 Re: Re: [GENERAL] Patch for PGACCESS