0007-fix-fpo-crash-instead-of-trigger-views.patch
application/octet-stream
Filename: 0007-fix-fpo-crash-instead-of-trigger-views.patch
Type: application/octet-stream
Part: 1
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
Series: patch 0007
| File | + | − |
|---|---|---|
| src/backend/rewrite/rewriteHandler.c | 10 | 0 |
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 ||