Re: CREATE or REPLACE function pg_catalog.*

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: John Hansen <john(at)geeknet(dot)com(dot)au>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE or REPLACE function pg_catalog.*
Date: 2004-11-10 23:42:25
Message-ID: 1778.1100130145@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> writes:
> On Thu, 2004-11-11 at 04:11, Tom Lane wrote:
>> 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.

> Then shouldn't we disallow the CREATE OR REPLACE FUNCTION?

We shouldn't disallow it completely; for instance you could validly
change the volatility or other attributes that way.

There might be an argument for rejecting an attempt to replace the
prolang or prosrc values of a built-in, but frankly I think it's a waste
of effort to code up such a thing ...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-11-11 00:18:59 Re: MAX/MIN optimization via rewrite (plus query rewrites generally)
Previous Message Neil Conway 2004-11-10 23:28:00 Re: CREATE or REPLACE function pg_catalog.*