postgresql/src/backend/access
Robert Haas b1ecb9b3fc Fix interaction of partitioned tables with BulkInsertState.
When copying into a partitioned table, the target heap may change from
one tuple to next.  We must ask ReadBufferBI() to get a new buffer
every time such change occurs.  To do that, use new function
ReleaseBulkInsertStatePin().  This fixes the bug that tuples ended up
being inserted into the wrong partition, which occurred exactly
because the wrong buffer was used.

Amit Langote, per a suggestion from Robert Haas.  Some cosmetic
adjustments by me.

Reports by 高增琦 (Gao Zengqi), Venkata B Nagothi, and
Ragnar Ouchterlony.

Discussion: http://postgr.es/m/CAFmBtr32FDOqofo8yG-4mjzL1HnYHxXK5S9OGFJ%3D%3DcJpgEW4vA%40mail.gmail.com
Discussion: http://postgr.es/m/CAEyp7J9WiX0L3DoiNcRrY-9iyw%3DqP%2Bj%3DDLsAnNFF1xT2J1ggfQ%40mail.gmail.com
Discussion: http://postgr.es/m/16d73804-c9cd-14c5-463e-5caad563ff77%40agama.tv
Discussion: http://postgr.es/m/CA+TgmoaiZpDVUUN8LZ4jv1qFE_QyR+H9ec+79f5vNczYarg5Zg@mail.gmail.com
2017-01-24 08:50:16 -05:00
..
brin Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
common Fix ALTER TABLE / SET TYPE for irregular inheritance 2017-01-09 19:26:58 -03:00
gin Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
gist Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
hash Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
heap Fix interaction of partitioned tables with BulkInsertState. 2017-01-24 08:50:16 -05:00
index Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
nbtree Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
rmgrdesc Fix race condition in reading commit timestamps 2017-01-19 18:24:17 -03:00
spgist Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
tablesample Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
transam Logical replication 2017-01-20 09:04:49 -05:00
Makefile TABLESAMPLE, SQL Standard and extensible 2015-05-15 14:37:10 -04:00