pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reject non-ON-SELECT rules that are named "_RETURN".
Date: Mon, 17 Oct 2022 16:14:54 +0000
Message-ID: <E1okSlS-002myZ-6y@gemulon.postgresql.org> (raw)

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_10_STABLE

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

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



view thread (7+ messages)  latest in thread

Message-ID: <E1okSlS-002myZ-6y@gemulon.postgresql.org>
Permalink:  ../E1okSlS-002myZ-6y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1okSlS-002myZ-6y@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Reject non-ON-SELECT rules that are named "_RETURN".
  In-Reply-To: <E1okSlS-002myZ-6y@gemulon.postgresql.org>
  References: <E1okSlS-002myZ-6y@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox