Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d672b7

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 thecode to support this case is in place for logical decoding. Theexisting code forgot to issue a XLOG_HEAP2_NEW_CID record for the firsttuple inserted, leading to failures when attempting to use multipleinserts for catalogs at decoding time. This commit fixes the problem byWAL-logging the needed CID.This is not an active bug, so no back-patch is done.Author: Daniel GustafssonDiscussion:https://postgr.es/m/E0D4CC67-A1CF-4DF4-991D-B3AC2EB5FAE9@yesql.se
1 parent3d47551 commit7d672b7

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
HeapTupleheaptup=heaptuples[ndone+nthispage];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp