Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL 13: error number of items mismatch in GIN entry tuple, 2 in tuple header, 19 decoded

I stuck with a problem with PostgreSQL at GCP that at some moment PostgreSQL starts to raise an error

number of items mismatch in GIN entry tuple, 2 in tuple header, 19 decoded 

It happens after insert in the table with GIN index on JSONB field
After the first occurrence of the error, it will occur regularly, but not on every insert operation

I tried to reinsert to test DB the same rows, several rows before and after the error appeared, everything was inserted successfully

Also, I see in the Postgres logs before the error starts to appear: automatic analyze of table <table-name>, maybe it can be helpful

like image 279
Nikita Davydov Avatar asked Mar 26 '21 15:03

Nikita Davydov


1 Answers

That is some kind of data corruption. If you want that investigated, you'll have to ask your hosting provider.

To get rid of the message, rebuild the index using REINDEX.

like image 180
Laurenz Albe Avatar answered Sep 28 '22 02:09

Laurenz Albe