Re: Rule recompilation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Alex Pilosov <alex(at)pilosoft(dot)com>, PostgreSQL HACKERS <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Rule recompilation
Date: 2001-07-12 19:46:04
Message-ID: 11855.994967164@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> For most objects, there is no such "recompile" possible - at
> least not without storing alot more information than now.
> Create a function and based on that an operator. Then you
> drop the function and create another one. Hmmm, pg_operator
> doesn't have the function name and argument types, it only
> knows the old functions oid. How do you find the new function
> from here?

What new function? The correct system behavior (as yet unimplemented)
would be to *drop* the operator the instant someone drops the underlying
function.

What is more interesting here is an (also unimplemented, but should
exist) ALTER FUNCTION command that can replace the definition text
of an existing function object. The link from the operator to the
function then does not change --- but we'd like to cause cached plans,
etc, to be rebuilt if they depend on the old function definition via
the operator.

I think it's wrong to see the problem as relinking primary definitions
to point at new objects. The primary definition of an object does not
need to change, what we need is to be able to update derived data.
pg_rewrite is currently broken in the sense that it's not storing a
primary definition (ie, rule source text).

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Pilosov 2001-07-12 19:46:33 Re: Rule recompilation
Previous Message Tom Lane 2001-07-12 19:39:28 Re: Rule recompilation