diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-06-14 16:19:46 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-06-14 16:19:46 -0400 |
commit | f32d57fd7088a558dadbe21b9859b09d2f877c19 (patch) | |
tree | e90add07782367d128db9c9f5d0c7319783bc14d /src/include/nodes | |
parent | 6c2003f8a1bbc7c192a2e83ec51581c018aa162f (diff) | |
download | postgresql-f32d57fd7088a558dadbe21b9859b09d2f877c19.tar.gz |
Fix problems related to RangeTblEntry members enrname and enrtuples.
Commit 18ce3a4ab22d2984f8540ab480979c851dae5338 failed to update
the comments in parsenodes.h for the new members, and made only
incomplete updates to src/backend/nodes
Thomas Munro, per a report from Noah Misch.
Discussion: http://postgr.es/m/20170611062525.GA1628882@rfd.leadboat.com
Diffstat (limited to 'src/include/nodes')
-rw-r--r-- | src/include/nodes/parsenodes.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 2d2e2c0fbc..271564fd23 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -944,6 +944,11 @@ 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. */ Oid relid; /* OID of the relation */ char relkind; /* relation kind (see pg_class.relkind) */ @@ -1004,16 +1009,23 @@ typedef struct RangeTblEntry bool self_reference; /* is this a recursive self-reference? */ /* - * Fields valid for values and CTE RTEs (else NIL): + * Fields valid for table functions, values, CTE and ENR RTEs (else NIL): * * We need these for CTE RTEs so that the types of self-referential * columns are well-defined. For VALUES RTEs, storing these explicitly * saves having to re-determine the info by scanning the values_lists. + * For ENRs, we store the types explicitly here (we could get the + * information from the catalogs if 'relid' was supplied, but we'd still + * need these for TupleDesc-based ENRs, so we might as well always store + * the type info here). */ List *coltypes; /* OID list of column type OIDs */ List *coltypmods; /* integer list of column typmods */ List *colcollations; /* OID list of column collation OIDs */ + /* + * Fields valid for ENR RTEs (else NULL/zero): + */ char *enrname; /* name of ephemeral named relation */ double enrtuples; /* estimated or actual from caller */ |