pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Retain relkind too in RTE_SUBQUERY entries for views.
Date: Wed, 14 Jun 2023 03:03:10 +0000
Message-ID: <E1q9Gms-001h5g-8Q@gemulon.postgresql.org> (raw)

Retain relkind too in RTE_SUBQUERY entries for views.

47bb9db75 modified the ApplyRetrieveRule()'s conversion of a view's
original RTE_RELATION entry into an RTE_SUBQUERY one to retain relid,
rellockmode, and perminfoindex so that the executor can lock the view
and check its permissions.  It seems better to also retain
relkind for cross-checking that the exception of an
RTE_SUBQUERY entry being allowed to carry relation details only
applies to views, so do so.

Bump catversion because this changes the output format of
RTE_SUBQUERY RTEs.

Suggested-by: David Steele <david@pgmasters.net>
Reviewed-by: David Steele <david@pgmasters.net>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/3953179e-9540-e5d1-a743-4bef368785b0%40pgmasters.net

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0f8cfaf8921fed35f0b92d918ce95eec7b46ff05

Modified Files
--------------
src/backend/executor/execMain.c      |  9 +++++++++
src/backend/nodes/outfuncs.c         |  1 +
src/backend/nodes/readfuncs.c        |  1 +
src/backend/rewrite/rewriteHandler.c |  7 +++----
src/include/catalog/catversion.h     |  2 +-
src/include/nodes/parsenodes.h       | 14 +++++++-------
6 files changed, 22 insertions(+), 12 deletions(-)



Message-ID: <E1q9Gms-001h5g-8Q@gemulon.postgresql.org>
Permalink:  ../E1q9Gms-001h5g-8Q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1q9Gms-001h5g-8Q@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: amitlan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Retain relkind too in RTE_SUBQUERY entries for views.
  In-Reply-To: <E1q9Gms-001h5g-8Q@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