diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index 021c73f1..9a9cc82c 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -1769,6 +1769,18 @@ ApplyRetrieveRule(Query *parsetree, * Also note that there's a hack in fireRIRrules to avoid calling this * function again when it arrives at the copied RTE. */ + + /* + * FOR PORTION OF requires access to the physical row to compute temporal leftovers. + * Views with INSTEAD OF triggers have no physical storage. + */ + if (parsetree->forPortionOf) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("FOR PORTION OF is not supported on views with INSTEAD OF triggers"))); + if (parsetree->commandType == CMD_INSERT) return parsetree; else if (parsetree->commandType == CMD_UPDATE ||