Thread: pgsql: Incidental cleanup of matviews code.

pgsql: Incidental cleanup of matviews code.

From
Tom Lane
Date:
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5194024d72f33fb209e10f9ab0ada7cc67df45b7

Modified Files
--------------
src/backend/commands/createas.c           |    1 -
src/backend/commands/matview.c            |   24 +---------
src/backend/executor/execMain.c           |   72 -----------------------------
src/backend/executor/execUtils.c          |   22 ++++++++-
src/backend/executor/nodeBitmapHeapscan.c |    2 +-
src/backend/executor/nodeForeignscan.c    |    2 +-
src/backend/executor/nodeIndexonlyscan.c  |    2 +-
src/backend/executor/nodeIndexscan.c      |    2 +-
src/backend/executor/nodeSeqscan.c        |   14 +++--
src/backend/executor/nodeTidscan.c        |    2 +-
src/backend/nodes/copyfuncs.c             |    1 -
src/backend/nodes/equalfuncs.c            |    1 -
src/backend/nodes/outfuncs.c              |    1 -
src/backend/nodes/readfuncs.c             |    1 -
src/backend/parser/analyze.c              |    5 --
src/backend/rewrite/rewriteHandler.c      |   31 +++++-------
src/include/catalog/catversion.h          |    2 +-
src/include/executor/executor.h           |    2 +-
src/include/nodes/parsenodes.h            |    3 +-
19 files changed, 49 insertions(+), 141 deletions(-)