Nikita Davydov
Nikita Davydov

Reputation: 957

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

Upvotes: 6

Views: 229

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246403

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.

Upvotes: 2

Related Questions