GIN tries to form a tuple with a partial compressedList during insertion - Mailing list pgsql-hackers

From Arseniy Mukhin
Subject GIN tries to form a tuple with a partial compressedList during insertion
Date
Msg-id CAE7r3M+C=jcpTD93f_RBHrQp3C+=TAXFs+k4tTuZuuxboK8AvA@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hi,

In the functions addItemPointersToLeafTuple and buildFreshLeafTuple
(in gininsert.c), the result of ginCompressPostingList()
is passed to GinFormTuple without checking whether
ginCompressPostingList() successfully packed all items.
These GinFormTuple calls consistently fail because the resulting
tuples always exceed the maximum size.
While this doesn’t result in data corruption, it might still be worth
addressing.
Additionally, the condition if (compressedList) is unnecessary, since
ginCompressPostingList() never returns NULL.

Please find the attached patch fixing it.

Best regards,
Arseniy Mukhin

Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Typo in multixact.c and jsonfuncs.c documentation
Next
From: Peter Eisentraut
Date:
Subject: Re: Doc: fix the rewrite condition when executing ALTER TABLE ADD COLUMN