Re: CREATE or REPLACE function pg_catalog.*

From: "John Hansen" <john(at)geeknet(dot)com(dot)au>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE or REPLACE function pg_catalog.*
Date: 2004-11-10 20:10:03
Message-ID: 5066E5A966339E42AA04BA10BA706AE56202@rodrick.geeknet.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > The builtin function is still called, not the userdefined
> function for
> > 'C' language functions.
>
> You can't override a builtin C function that way because
> there is a built-in map from function OID to builtin function
> address, and it's consulted before trying to look in pg_proc.

That doesn't make sense, since if I delete the entry from pg_proc and
then create the funtion, everything works fine.

Eg: delete from pg_proc whete proname = 'funcname'; create function
pg_catalog.funcname();

> This behavior is not really open to negotiation; not only on
> grounds of speed, but on grounds of circularity. (The
> functions used in the process of looking up entries in
> pg_proc itself obviously must have such a short circuit...)
> You'd have to build a modified backend in which the
> particular functions you want to replace are not listed in
> the builtin mapping table.
>
> regards, tom lane

Well, as someone pointed out, if it is possible to execute replace
function on a builtin, then it should work.

... John

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2004-11-10 20:25:20 Re: Increasing the length of pg_stat_activity.current_query...
Previous Message Chris Albertson 2004-11-10 18:21:29 Re: [Pgsphere-dev] GIST index concurrency concern