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

From Tom Lane
Subject Re: CREATE or REPLACE function pg_catalog.*
Date
Msg-id 13626.1100106687@sss.pgh.pa.us
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.*  (elein <elein@varlena.com>)
Re: CREATE or REPLACE function pg_catalog.*  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
John Hansen <john@geeknet.com.au> writes:
> When doing CREATE or REPLACE FUNCTION of a builtin function, it seems to
> have no effect if its in the 'C" language. SQL functions seem to work,
> but as neilc pointed out, it may be due to the SQL function being
> inlined.
> 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.

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: A modest proposal: get rid of GUC's USERLIMIT variable category
Next
From: Tom Lane
Date:
Subject: Re: A modest proposal: get rid of GUC's USERLIMIT variable category