Hi,
I'd like to add another column to pg_rewrite, holding the string representation of the rewrite rule. A new
utility command will then allow to recreate the rules (internally DROP/CREATE, but that doesn't matter).
This would be a big help in case anything used in a view or other rules get's dropped and recreated (like
underlying tables). There is of course a difference between the original CREATE RULE/VIEW statement and the string
storedhere. This is because we cannot rely on the actual query buffer but have to parseback the parsetree like done
bythe utility functions used for pg_rules. Thus, changing a column name of a base table will break the view
eitherway.
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.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com