diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index e1c2639fde..7cd31cb6ab 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -1895,6 +1895,13 @@ postgresExecForeignUpdate(EState *estate, MemoryContextReset(fmstate->temp_cxt); + /* ERROR if more than one row was updated on the remote end */ + if (n_rows > 1) + ereport(ERROR, + (errcode (ERRCODE_FDW_ERROR), /* XXX */ + errmsg ("updated %d rows for a tuple identity on the remote end", + n_rows))); + /* Return NULL if nothing was updated on the remote end */ return (n_rows > 0) ? slot : NULL; }