Skip site navigation (1) Skip section navigation (2)

Re: Support for %TYPE in CREATE FUNCTION

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 17:48:20
Message-ID: 3.0.1.32.20010530104820.0181e870@mail.pacifier.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
At 12:30 PM 5/30/01 -0400, Tom Lane wrote:
>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 happens now with PL/pgSQL variables?  Does it continue to point
int4 as long as the backend stays alive, but switch in new backends
as they come to life, the function gets called, and the body recompiled?

(Compiled bytes are stored on a per-backend basis, right?  Or wrong? :)

That's not particularly relevant to the parameter case other than to
point out that we may already have some weirdness in PL/pgSQL in
this regard.



- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
  Nature photos, on-line guides, Pacific Northwest
  Rare Bird Alert Service and other goodies at
  http://donb.photo.net.

In response to

Responses

pgsql-hackers by date

Next:From: The Hermit HackerDate: 2001-05-30 17:55:48
Subject: intelligence in writing a query ...
Previous:From: Tom LaneDate: 2001-05-30 17:25:16
Subject: Re: Support for %TYPE in CREATE FUNCTION

pgsql-patches by date

Next:From: Ian Lance TaylorDate: 2001-05-30 18:01:54
Subject: Re: Support for %TYPE in CREATE FUNCTION
Previous:From: Tom LaneDate: 2001-05-30 17:25:16
Subject: Re: Support for %TYPE in CREATE FUNCTION

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group