]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Reject non-ON-SELECT rules that are named "_RETURN".
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 17 Oct 2022 16:14:39 +0000 (12:14 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 17 Oct 2022 16:14:39 +0000 (12:14 -0400)
commit65c1106d8c5bea72b30c257d992c0d42f1b52440
tree07eb6c882e724fa02fa185e8439edc217b3e34dc
parent99b6b705d439fbf72aefe968941f38d571b9231c
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
src/backend/rewrite/rewriteDefine.c