public inbox for [email protected]  
help / color / mirror / Atom feed
From: Wim Rouquart <[email protected]>
To: Adrian Klaver <[email protected]>
To: [email protected] <[email protected]>
Subject: RE: Index (primary key) corrupt?
Date: Fri, 19 Sep 2025 13:23:08 +0000
Message-ID: <AS2PR05MB10754A51AB7FC85161189FF7CEF11A@AS2PR05MB10754.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <[email protected]>
References: <AS2PR05MB1075477BA334D4DA262AD75BFEF16A@AS2PR05MB10754.eurprd05.prod.outlook.com>
	<[email protected]>
	<AS2PR05MB107548567EEDAAB3AF74A6C59EF11A@AS2PR05MB10754.eurprd05.prod.outlook.com>
	<[email protected]>

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?
>>
>> CREATE TABLE bcf_work_type (
>>          id bigserial NOT NULL,
>>          aml_score int8 NOT NULL,
>>          CONSTRAINT idx_376814_primary PRIMARY KEY (id) );

>The table was defined in one step using the above definition? Or was the the PK added later?

I'm not the developer of the application, can't really answer these ones I'm afraid.

> What is the result for the query?:

> select * from pg_index where indexrelid  = 'idx_376814_primary'::regclass;

Name               |Value  |
-------------------+-------+
indexrelid         |2006873|
indrelid           |1998823|
indnatts           |1      |
indnkeyatts        |1      |
indisunique        |true   |
indnullsnotdistinct|false  |
indisprimary       |true   |
indisexclusion     |false  |
indimmediate       |true   |
indisclustered     |false  |
indisvalid         |true   |
indcheckxmin       |false  |
indisready         |true   |
indislive          |true   |
indisreplident     |false  |
indkey             |{}     |
indcollation       |{}     |
indclass           |{}     |
indoption          |{}     |
indexprs           |       |
indpred            |       |


> How is the table populated with data?

Same answer as above.

>>
>>> What is the complete pg_dump command being given?
>>
>> pg_dump --verbose -p <xxx> -U <xxx> -d <xxx> > dumpverbose.sql 2>
>> dumpverbose.log
>>
>>> Is the PK definition in the pg_dump file? For plain text format can you grep/find it?
>>
>> It is in neither, that’s why I'm sure it doesn't get exported. After a REINDEX statement it is.
>>
>>> How is the dump file being restored?
>>
>> As the code to generate the index is not in the dumpfile this seems irrelevant to me.
>>


Disclaimer <https://www.kbc.com/KBCmailDisclaimer;


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: RE: Index (primary key) corrupt?
  In-Reply-To: <AS2PR05MB10754A51AB7FC85161189FF7CEF11A@AS2PR05MB10754.eurprd05.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox