Re: Support for %TYPE in CREATE FUNCTION - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Support for %TYPE in CREATE FUNCTION
Date
Msg-id 200105290113.f4T1DqO05559@candle.pha.pa.us
Whole thread Raw
In response to Re: Support for %TYPE in CREATE FUNCTION  (Ian Lance Taylor <ian@airs.com>)
Responses Re: Support for %TYPE in CREATE FUNCTION  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>
> > Sorry, looks like this patch has to be rejected because it can not
> > handle table changes.
>
> > > This patch adds support for %TYPE in CREATE FUNCTION argument and
> > > return types.
>
> Does anybody want to suggest how to handle table changes?  Does
> anybody want to work with me to make this patch acceptable?  Or is
> this functionality of no interest to the Postgres development team?

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.  We may then be able to recreate the function on table change, but
I think we will need this TODO item done also:

    * Add pg_depend table to track object dependencies

So it seems we need two items done first, then we would have the tools
to properly implement this functionality.

So, yes, the functionality is desired, but it has to be done with the
proper groundwork already in place.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Proceeding with gettext
Next
From: Peter Eisentraut
Date:
Subject: Re: Proceeding with gettext