Remove a unnecessary function call
It was added by 3de95c09 for consistency with the patch version
proposed for PostgreSQL core, but the called function was not
one we intended. Fortunately, the behavior has not been affected.
Now, I decided to remove this funciton since I come to think it is
confusable.
Also, added some comments on an argument left for the similar
consistency.
This commit is contained in:
parent
b4b5ea28fd
commit
7997f3e260
2 changed files with 14 additions and 3 deletions
14
createas.c
14
createas.c
|
|
@ -466,6 +466,13 @@ CreateIvmTriggersOnBaseTables(Query *qry, Oid matviewOid, bool is_create)
|
|||
Index first_rtindex = is_create ? 1 : PRS2_NEW_VARNO + 1;
|
||||
RangeTblEntry *rte;
|
||||
|
||||
/*
|
||||
* is_create must be true in pg_ivm because the view definition doesn't
|
||||
* contain NEW/OLD RTE.
|
||||
* XXX: This argument should be removed?
|
||||
*/
|
||||
Assert(is_create);
|
||||
|
||||
/* Immediately return if we don't have any base tables. */
|
||||
if (list_length(qry->rtable) < first_rtindex)
|
||||
return;
|
||||
|
|
@ -1095,6 +1102,13 @@ CreateIndexOnIMMV(Query *query, Relation matviewRel, bool is_create)
|
|||
ListCell *indexoidscan;
|
||||
|
||||
|
||||
/*
|
||||
* is_create must be true in pg_ivm because the view definition doesn't
|
||||
* contain NEW/OLD RTE.
|
||||
* XXX: This argument should be removed?
|
||||
*/
|
||||
Assert(is_create);
|
||||
|
||||
/*
|
||||
* For aggregate without GROUP BY, we do not need to create an index
|
||||
* because the view has only one row.
|
||||
|
|
|
|||
|
|
@ -447,10 +447,7 @@ ExecRefreshImmv(const RangeVar *relation, bool skipData,
|
|||
pgstat_count_heap_insert(matviewRel, processed);
|
||||
|
||||
if (!skipData && !oldPopulated)
|
||||
{
|
||||
CreateIvmTriggersOnBaseTables(viewQuery, matviewOid, true);
|
||||
CreateIvmTriggersOnBaseTables(dataQuery, matviewOid, false);
|
||||
}
|
||||
|
||||
table_close(matviewRel, NoLock);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue