mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Incidental cleanup of matviews code.
Move checking for unscannable matviews into ExecOpenScanRelation, which is a better place for it first because the open relation is already available (saving a relcache lookup cycle), and second because this eliminates the problem of telling the difference between rangetable entries that will or will not be scanned by the query. In particular we can get rid of the not-terribly-well-thought-out-or-implemented isResultRel field that the initial matviews patch added to RangeTblEntry. Also get rid of entirely unnecessary scannability check in the rewriter, and a bogus decision about whether RefreshMatViewStmt requires a parse-time snapshot. catversion bump due to removal of a RangeTblEntry field, which changes stored rules.
This commit is contained in:
@@ -53,6 +53,6 @@
|
||||
*/
|
||||
|
||||
/* yyyymmddN */
|
||||
#define CATALOG_VERSION_NO 201304151
|
||||
#define CATALOG_VERSION_NO 201304271
|
||||
|
||||
#endif
|
||||
|
@@ -341,7 +341,7 @@ extern void ExecAssignScanTypeFromOuterPlan(ScanState *scanstate);
|
||||
|
||||
extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid);
|
||||
|
||||
extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid);
|
||||
extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags);
|
||||
extern void ExecCloseScanRelation(Relation scanrel);
|
||||
|
||||
extern void ExecOpenIndices(ResultRelInfo *resultRelInfo);
|
||||
|
@@ -713,7 +713,6 @@ typedef struct RangeTblEntry
|
||||
*/
|
||||
Oid relid; /* OID of the relation */
|
||||
char relkind; /* relation kind (see pg_class.relkind) */
|
||||
bool isResultRel; /* used in target of SELECT INTO or similar */
|
||||
|
||||
/*
|
||||
* Fields valid for a subquery RTE (else NULL):
|
||||
@@ -2461,7 +2460,7 @@ typedef struct CreateTableAsStmt
|
||||
NodeTag type;
|
||||
Node *query; /* the query (see comments above) */
|
||||
IntoClause *into; /* destination table */
|
||||
ObjectType relkind; /* type of object */
|
||||
ObjectType relkind; /* OBJECT_TABLE or OBJECT_MATVIEW */
|
||||
bool is_select_into; /* it was written as SELECT INTO */
|
||||
} CreateTableAsStmt;
|
||||
|
||||
|
Reference in New Issue
Block a user