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

Started by Tom Lanealmost 4 years ago1 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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: /messages/by-id/17646-70c93cfa40365776@postgresql.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e9377e3e53e6d7dc9458e296aba06af6b58dae7a

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