diff options
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index fd20aa96aa9..6f9c6e193fc 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -3947,11 +3947,12 @@ apply_returning_filter(PgFdwDirectModifyState *dmstate, ExecStoreVirtualTuple(resultSlot); /* - * If we have any system columns to return, install them. + * If we have any system columns to return, materialize a heap tuple in the + * slot from column values set above and install system columns in that tuple. */ if (dmstate->hasSystemCols) { - HeapTuple resultTup = ExecMaterializeSlot(resultSlot); + HeapTuple resultTup = ExecFetchSlotHeapTuple(resultSlot, true, NULL); /* ctid */ if (dmstate->ctidAttno) |