Re: Rule recompilation - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Rule recompilation
Date
Msg-id 11596.994963838@sss.pgh.pa.us
Whole thread Raw
In response to Rule recompilation  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
Jan Wieck <JanWieck@Yahoo.com> writes:
>     There is of course a difference between the original
>     CREATE  RULE/VIEW  statement and the string stored here. This
>     is because we cannot rely on the actual query buffer but have
>     to parseback the parsetree like done by the utility functions
>     used for pg_rules.

Did you see my comments about extending the parser to make it possible
to extract the appropriate part of the query buffer?  This would allow
us to get rid of the reverse-lister (ruleutils.c) entirely, not to
mention readfuncs.c (but we'd still want outfuncs.c for debugging, I
suppose).

>     Anyway,  what's  the preferred syntax for triggering the rule
>     recompilation?  I thought about
>         ALTER RULE {rulename|ALL} RECOMPILE;
>     Where ALL triggers only those rules where the  user  actually
>     has RULE access right on a relation.

The proposed definition of ALL seems completely off-base.  If I have
changed my table foo, which is referenced by a rule attached to
Joe's table bar, I would like to be able to force recompilation of
Joe's rule.  If I can't do that, a RECOMPILE command is useless.
I might as well just restart my backend.

BTW, a RECOMPILE command that affects only the current backend is pretty
useless anyway.  How are you going to propagate the recompile request to
other backends?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Rule recompilation
Next
From: Alex Pilosov
Date:
Subject: Re: Rule recompilation