We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent32fb454 commitdea5f6cCopy full SHA for dea5f6c
src/backend/access/heap/heapam.c
@@ -2093,8 +2093,11 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
2093
char*scratch=NULL;
2094
Pagepage;
2095
boolneedwal;
2096
+SizesaveFreeSpace;
2097
2098
needwal= !(options&HEAP_INSERT_SKIP_WAL)&&RelationNeedsWAL(relation);
2099
+saveFreeSpace=RelationGetTargetPageFreeSpace(relation,
2100
+HEAP_DEFAULT_FILLFACTOR);
2101
2102
/* Toast and set header data in all the tuples */
2103
heaptuples=palloc(ntuples*sizeof(HeapTuple));
@@ -2157,7 +2160,7 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
2157
2160
{
2158
2161
HeapTupleheaptup=heaptuples[ndone+nthispage];
2159
2162
-if (PageGetHeapFreeSpace(page)<MAXALIGN(heaptup->t_len))
2163
+if (PageGetHeapFreeSpace(page)-saveFreeSpace<MAXALIGN(heaptup->t_len))
2164
break;
2165
2166
RelationPutHeapTuple(relation,buffer,heaptup);