pgsql: Reject non-ON-SELECT rules that are named "_RETURN". - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Reject non-ON-SELECT rules that are named "_RETURN".
Date
Msg-id E1okSlS-002myN-4f@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Reject non-ON-SELECT rules that are named "_RETURN".

DefineQueryRewrite() has long required that ON SELECT rules be named
"_RETURN".  But we overlooked the converse case: we should forbid
non-ON-SELECT rules that are named "_RETURN".  In particular this
prevents using CREATE OR REPLACE RULE to overwrite a view's _RETURN
rule with some other kind of rule, thereby breaking the view.

Per bug #17646 from Kui Liu.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/17646-70c93cfa40365776@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2f26cec4884366cc23737c5a9b7797935057ce38

Modified Files
--------------
src/backend/rewrite/rewriteDefine.c | 12 ++++++++++++
1 file changed, 12 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Guard against table-AM-less relations in planner.
Next
From: Tom Lane
Date:
Subject: pgsql: Record dependencies of a cast on other casts that it requires.