diff options
author | Amit Langote <amitlan@postgresql.org> | 2023-06-13 12:52:47 +0900 |
---|---|---|
committer | Amit Langote <amitlan@postgresql.org> | 2023-06-14 12:00:10 +0900 |
commit | 0f8cfaf8921fed35f0b92d918ce95eec7b46ff05 (patch) | |
tree | bab872e8982f9a5ed3e119a0bc77a7996858a887 /src/backend/nodes/outfuncs.c | |
parent | ae66716bf3ef6fa9b33904eaf15441813a150320 (diff) | |
download | postgresql-0f8cfaf8921fed35f0b92d918ce95eec7b46ff05.tar.gz postgresql-0f8cfaf8921fed35f0b92d918ce95eec7b46ff05.zip |
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
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index ba00b99249f..955286513d2 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -513,6 +513,7 @@ _outRangeTblEntry(StringInfo str, const RangeTblEntry *node) WRITE_BOOL_FIELD(security_barrier); /* we re-use these RELATION fields, too: */ WRITE_OID_FIELD(relid); + WRITE_CHAR_FIELD(relkind); WRITE_INT_FIELD(rellockmode); WRITE_UINT_FIELD(perminfoindex); break; |