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 parent6de4605 commiteeb0a98Copy full SHA for eeb0a98
src/rum_ts_utils.c
@@ -539,8 +539,14 @@ rum_extract_tsvector_internal(TSVectorvector,
539
if (we->haspos)
540
{
541
posVec=_POSVECPTR(vector,we);
542
+
543
+/*
544
+ * In some cases compressed positions may take more memory than
545
+ * uncompressed positions. So allocate memory with a margin.
546
+ */
547
posDataSize=VARHDRSZ+2*posVec->npos*sizeof(WordEntryPos);
548
posData= (bytea*)palloc(posDataSize);
549
550
posDataSize=compress_pos(posData->vl_dat,posVec->pos,posVec->npos)+VARHDRSZ;
551
SET_VARSIZE(posData,posDataSize);
552
@@ -1579,6 +1585,10 @@ rum_ts_join_pos(PG_FUNCTION_ARGS)
1579
1585
1580
1586
Assert(countRes <= (count1+count2));
1581
1587
1588
1589
1590
1591
1582
1592
size=VARHDRSZ+2*sizeof(WordEntryPos)*countRes;
1583
1593
result=palloc(size);
1584
1594