@@ -944,6 +944,11 @@ typedef struct RangeTblEntry
944
944
945
945
/*
946
946
* Fields valid for a plain relation RTE (else zero):
947
+ *
948
+ * As a special case, RTE_NAMEDTUPLESTORE can also set relid to indicate
949
+ * that the tuple format of the tuplestore is the same as the referenced
950
+ * relation. This allows plans referencing AFTER trigger transition
951
+ * tables to be invalidated if the underlying table is altered.
947
952
*/
948
953
Oid relid ; /* OID of the relation */
949
954
char relkind ; /* relation kind (see pg_class.relkind) */
@@ -1004,16 +1009,23 @@ typedef struct RangeTblEntry
1004
1009
bool self_reference ; /* is this a recursive self-reference? */
1005
1010
1006
1011
/*
1007
- * Fields valid for values and CTE RTEs (else NIL):
1012
+ * Fields valid for table functions, values, CTE and ENR RTEs (else NIL):
1008
1013
*
1009
1014
* We need these for CTE RTEs so that the types of self-referential
1010
1015
* columns are well-defined. For VALUES RTEs, storing these explicitly
1011
1016
* saves having to re-determine the info by scanning the values_lists.
1017
+ * For ENRs, we store the types explicitly here (we could get the
1018
+ * information from the catalogs if 'relid' was supplied, but we'd still
1019
+ * need these for TupleDesc-based ENRs, so we might as well always store
1020
+ * the type info here).
1012
1021
*/
1013
1022
List * coltypes ; /* OID list of column type OIDs */
1014
1023
List * coltypmods ; /* integer list of column typmods */
1015
1024
List * colcollations ; /* OID list of column collation OIDs */
1016
1025
1026
+ /*
1027
+ * Fields valid for ENR RTEs (else NULL/zero):
1028
+ */
1017
1029
char * enrname ; /* name of ephemeral named relation */
1018
1030
double enrtuples ; /* estimated or actual from caller */
1019
1031
0 commit comments