Move warning
This commit is contained in:
parent
7f71f7c5e7
commit
7ad10b48ef
1 changed files with 10 additions and 9 deletions
11
pg_ivm.c
11
pg_ivm.c
|
|
@ -273,19 +273,20 @@ IVM_prevent_immv_change(PG_FUNCTION_ARGS)
|
||||||
TriggerData *trigdata = (TriggerData *) fcinfo->context;
|
TriggerData *trigdata = (TriggerData *) fcinfo->context;
|
||||||
Relation rel = trigdata->tg_relation;
|
Relation rel = trigdata->tg_relation;
|
||||||
|
|
||||||
if (ImmvIncrementalMaintenanceIsEnabled())
|
|
||||||
return PointerGetDatum(NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we are maintaining an IMMV, this warning would have been emitted by
|
* This warning is shown regardless of whether the user is manually
|
||||||
* the IVM_immediate_* triggers, so there is no need to emit it again.
|
* modifying the materialized view, or the extension is performing
|
||||||
|
* incremental maintenance.
|
||||||
*/
|
*/
|
||||||
warnIfPgIvmNotPreloaded();
|
warnIfPgIvmNotPreloaded();
|
||||||
|
|
||||||
|
if (!ImmvIncrementalMaintenanceIsEnabled())
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
|
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
|
||||||
errmsg("cannot change materialized view \"%s\"",
|
errmsg("cannot change materialized view \"%s\"",
|
||||||
RelationGetRelationName(rel))));
|
RelationGetRelationName(rel))));
|
||||||
|
|
||||||
|
return PointerGetDatum(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue