aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2014-07-12 14:28:19 +0200
committerAndres Freund <andres@anarazel.de>2014-07-12 14:28:19 +0200
commit626bfad6cc5701eb385b8995e1431ad6a5f24928 (patch)
tree08e8c7575168e5174696ecb90b7b09efd641b8c8 /src/include
parentdeee42ab015d54baa1b9e0165bf3635dab4f9f7a (diff)
downloadpostgresql-626bfad6cc5701eb385b8995e1431ad6a5f24928.tar.gz
postgresql-626bfad6cc5701eb385b8995e1431ad6a5f24928.zip
Fix decoding of consecutive MULTI_INSERTs emitted by one heap_multi_insert().
Commit 1b86c81d2d fixed the decoding of toasted columns for the rows contained in one xl_heap_multi_insert record. But that's not actually enough, because heap_multi_insert() will actually first toast all passed in rows and then emit several *_multi_insert records; one for each page it fills with tuples. Add a XLOG_HEAP_LAST_MULTI_INSERT flag which is set in xl_heap_multi_insert->flag denoting that this multi_insert record is the last emitted by one heap_multi_insert() call. Then use that flag in decode.c to only set clear_toast_afterwards in the right situation. Expand the number of rows inserted via COPY in the corresponding regression test to make sure that more than one heap page is filled with tuples by one heap_multi_insert() call. Backpatch to 9.4 like the previous commit.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/heapam_xlog.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/access/heapam_xlog.h b/src/include/access/heapam_xlog.h
index 05beb005450..e964ecce461 100644
--- a/src/include/access/heapam_xlog.h
+++ b/src/include/access/heapam_xlog.h
@@ -69,6 +69,8 @@
#define XLOG_HEAP_CONTAINS_NEW_TUPLE (1<<4)
#define XLOG_HEAP_PREFIX_FROM_OLD (1<<5)
#define XLOG_HEAP_SUFFIX_FROM_OLD (1<<6)
+/* last xl_heap_multi_insert record for one heap_multi_insert() call */
+#define XLOG_HEAP_LAST_MULTI_INSERT (1<<7)
/* convenience macro for checking whether any form of old tuple was logged */
#define XLOG_HEAP_CONTAINS_OLD \