I have a table in a postgresql database (version 9.6) which stores pdf documents. When I try to vacuum this table the following error message comes up:
unexpected chunk number 57 (expected 25) for toast value 1047226 in pg_toast_1027390
If I look into the toast table itself I can see, that the chunk number is incorrect, but is there any way to correct it? Or is there a way to identify the TOAST pointer in the normal relation to identify which pdf document is affected?
What I did so far is to reindex and to vacuum the associated toast table which both succeeded. Vacuuming of the normal relation failed. I also tried to export and import all data into a new database with no success. The error in the toast table remains. A pg_dump also fails.