Content-Length: 270389 | pFad | http://github.com/postgrespro/postgres_cluster/commit/7d672b76bf27327dc3527dabcd8be4e2dedf430f

4B Issue properly WAL record for CID of first catalog tuple in multi-insert · postgrespro/postgres_cluster@7d672b7 · GitHub
Skip to content

Commit 7d672b7

Browse files
committed
Issue properly WAL record for CID of first catalog tuple in multi-insert
Multi-insert for heap is not yet used actively for catalogs, but the code to support this case is in place for logical decoding. The existing code forgot to issue a XLOG_HEAP2_NEW_CID record for the first tuple inserted, leading to failures when attempting to use multiple inserts for catalogs at decoding time. This commit fixes the problem by WAL-logging the needed CID. This is not an active bug, so no back-patch is done. Author: Daniel Gustafsson Discussion: https://postgr.es/m/E0D4CC67-A1CF-4DF4-991D-B3AC2EB5FAE9@yesql.se
1 parent 3d47551 commit 7d672b7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/access/heap/heapam.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,14 @@ heap_multi_insert(Relation relation, TupleTableSlot **slots, int ntuples,
21912191
* Put that on the page, and then as many other tuples as fit.
21922192
*/
21932193
RelationPutHeapTuple(relation, buffer, heaptuples[ndone], false);
2194+
2195+
/*
2196+
* Note that heap_multi_insert is not used for catalog tuples yet,
2197+
* but this will cover the gap once that is the case.
2198+
*/
2199+
if (needwal && need_cids)
2200+
log_heap_new_cid(relation, heaptuples[ndone]);
2201+
21942202
for (nthispage = 1; ndone + nthispage < ntuples; nthispage++)
21952203
{
21962204
HeapTuple heaptup = heaptuples[ndone + nthispage];

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/7d672b76bf27327dc3527dabcd8be4e2dedf430f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy