diff options
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 048db542d34..16320170cee 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -2043,8 +2043,9 @@ postgresGetForeignModifyBatchSize(ResultRelInfo *resultRelInfo) batch_size = get_batch_size_option(resultRelInfo->ri_RelationDesc); /* - * Disable batching when we have to use RETURNING or there are any - * BEFORE/AFTER ROW INSERT triggers on the foreign table. + * Disable batching when we have to use RETURNING, there are any + * BEFORE/AFTER ROW INSERT triggers on the foreign table, or there are any + * WITH CHECK OPTION constraints from parent views. * * When there are any BEFORE ROW INSERT triggers on the table, we can't * support it, because such triggers might query the table we're inserting @@ -2052,6 +2053,7 @@ postgresGetForeignModifyBatchSize(ResultRelInfo *resultRelInfo) * and prepared for insertion are not there. */ if (resultRelInfo->ri_projectReturning != NULL || + resultRelInfo->ri_WithCheckOptions != NIL || (resultRelInfo->ri_TrigDesc && (resultRelInfo->ri_TrigDesc->trig_insert_before_row || resultRelInfo->ri_TrigDesc->trig_insert_after_row))) |