git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 6b787d9) | patch
Fix copying data into slots with FDW batching
2021年6月16日 20:53:31 +0000 (22:53 +0200)
2021年6月16日 21:49:25 +0000 (23:49 +0200)
commit 99cea49d6525e30bc3768e4ffb95377e7584dea1
Fix copying data into slots with FDW batching

Commit b676ac443b optimized handling of tuple slots with bulk inserts
into foreign tables, so that the slots are initialized only once and
reused for all batches. The data was however copied into the slots only
after the initialization, inserting duplicate values when the slot gets
reused. Fixed by moving the ExecCopySlot outside the init branch.

The existing postgres_fdw tests failed to catch this due to inserting
data into foreign tables without unique indexes, and then checking only
the number of inserted rows. This adds a new test with both a unique
index and a check of inserted values.

Reported-by: Alexander Pyhalov
Discussion: https://postgr.es/m/7a8cf8d56b3d18e5c0bccd6cd42d04ac%40postgrespro.ru
contrib/postgres_fdw/expected/postgres_fdw.out diff | blob | blame | history
contrib/postgres_fdw/sql/postgres_fdw.sql diff | blob | blame | history
src/backend/executor/nodeModifyTable.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /