Add checks to DefineQueryRewrite() to prohibit attaching rules to relations

Tom Lane <tgl@sss.pgh.pa.us>

Commit: a7107136445914dcfaee7fed4cf65314f73cc6b7
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-05-13T22:32:55Z
Releases: 8.4.0
Add checks to DefineQueryRewrite() to prohibit attaching rules to relations
that aren't RELKIND_RELATION or RELKIND_VIEW, and to disallow attaching rules
to system relations unless allowSystemTableMods is on.  This is to make the
behavior of CREATE RULE more like CREATE TRIGGER, which disallows the
comparable cases.  Per discussion of bug #4808.

Files

PathChange+/−
src/backend/rewrite/rewriteDefine.c modified +18 −1