Re: CREATE or REPLACE function pg_catalog.* - Mailing list pgsql-hackers

From John Hansen
Subject Re: CREATE or REPLACE function pg_catalog.*
Date
Msg-id 5066E5A966339E42AA04BA10BA706AE56202@rodrick.geeknet.com.au
Whole thread Raw
In response to CREATE or REPLACE function pg_catalog.*  (John Hansen <john@geeknet.com.au>)
Responses Re: CREATE or REPLACE function pg_catalog.*  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CREATE or REPLACE function pg_catalog.*
Next
From: Jan Wieck
Date:
Subject: Re: Increasing the length of pg_stat_activity.current_query...