pgsql: Retain relkind too in RTE_SUBQUERY entries for views.

From: Amit Langote <amitlan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Retain relkind too in RTE_SUBQUERY entries for views.
Date: 2023-06-14 03:03:10
Message-ID: E1q9Gms-001h5g-8Q@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)pgmasters(dot)net>
Reviewed-by: David Steele <david(at)pgmasters(dot)net>
Reviewed-by: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2023-06-14 04:30:46 pgsql: Fix typo in comment.
Previous Message Tatsuo Ishii 2023-06-14 02:15:07 pgsql: Fix make_etags breakage on certain platforms.