diff options
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r-- | src/include/nodes/parsenodes.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index cfeca96d532..f39ab8586a5 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1009,11 +1009,6 @@ typedef struct RangeTblEntry /* * Fields valid for a plain relation RTE (else zero): * - * As a special case, RTE_NAMEDTUPLESTORE can also set relid to indicate - * that the tuple format of the tuplestore is the same as the referenced - * relation. This allows plans referencing AFTER trigger transition - * tables to be invalidated if the underlying table is altered. - * * rellockmode is really LOCKMODE, but it's declared int to avoid having * to include lock-related headers here. It must be RowExclusiveLock if * the RTE is an INSERT/UPDATE/DELETE/MERGE target, else RowShareLock if @@ -1028,6 +1023,19 @@ typedef struct RangeTblEntry * perminfoindex is 1-based index of the RTEPermissionInfo belonging to * this RTE in the containing struct's list of same; 0 if permissions need * not be checked for this RTE. + * + * As a special case, relid, rellockmode, and perminfoindex can also be + * set (nonzero) in an RTE_SUBQUERY RTE. This occurs when we convert an + * RTE_RELATION RTE naming a view into an RTE_SUBQUERY containing the + * view's query. We still need to perform run-time locking and permission + * checks on the view, even though it's not directly used in the query + * anymore, and the most expedient way to do that is to retain these + * fields from the old state of the RTE. + * + * As a special case, RTE_NAMEDTUPLESTORE can also set relid to indicate + * that the tuple format of the tuplestore is the same as the referenced + * relation. This allows plans referencing AFTER trigger transition + * tables to be invalidated if the underlying table is altered. */ Oid relid; /* OID of the relation */ char relkind; /* relation kind (see pg_class.relkind) */ |