Re: Index (primary key) corrupt? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Index (primary key) corrupt?
Date
Msg-id 1bfa0b6b-11a8-458f-a3f3-3f86574abc1d@aklaver.com
Whole thread Raw
In response to Index (primary key) corrupt?  (Wim Rouquart <wim.rouquart@kbc.be>)
Responses RE: Index (primary key) corrupt?
List pgsql-general
On 9/18/25 05:25, Wim Rouquart wrote:
> Internal
> 
> 
> Hello,
> 
> When doing a pg_dump of one of our databases one of the tables primary 
> keys doesn’t get exported. Pg_dump just skips this index, without any 
> warning whatsoever (verbose mode was used to doublecheck).

What is the complete table definition?

What is the complete pg_dump command being given?

Is the PK definition in the pg_dump file?
    For plain text format can you grep/find it?
    For custom format does:
       pg_restore -s -t <the_table>  <dump_file>
    show it?

How is the dump file being restored?

> 
> When doing a REINDEX the issue is fixed.
> 
> As this seems to me to be some form of index corruption, I tried using 
> amcheck (bt_index_check and bt_index_parent_check) to verify for 
> corruption but both resulted with no issues (the index is a btree).
> 
> I would expect the corruption to show up when using amcheck, am I 
> hitting some kind of bug here?
> 
> Are there any other ways to doublecheck for corruption (without enabling 
> checksum upfront)?
> 
> This concerns a PostgreSQL version 15 btw.
> 
> Thanks!
> 
> 
> Disclaimer <https://www.kbc.com/KBCmailDisclaimer>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_restore scan
Next
From: Adrian Klaver
Date:
Subject: Re: How do I specify the NetworkService user to the postgres installer.