public inbox for [email protected]
help / color / mirror / Atom feedRE: Index (primary key) corrupt?
5+ messages / 4 participants
[nested] [flat]
* RE: Index (primary key) corrupt?
@ 2025-09-19 09:29 Wim Rouquart <[email protected]>
2025-09-20 15:00 ` Re: Index (primary key) corrupt? Adrian Klaver <[email protected]>
2025-09-20 15:23 ` Re: Index (primary key) corrupt? David G. Johnston <[email protected]>
0 siblings, 2 replies; 5+ messages in thread
From: Wim Rouquart @ 2025-09-19 09:29 UTC (permalink / raw)
To: Ron Johnson <[email protected]>; [email protected] <[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).
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?
>> Does this problem keep happening, or has it only happened once?
It is consistent on this database/index, haven’t noticed it anywhere else yet luckily. Seems to be a one-off.
Are there any other ways to doublecheck for corruption (without enabling checksum upfront)?
>> pg_checksums is available in PG 15.
It is indeed, so to test I enabled checksums, and did a checksum test, no errors, and yes, the file containing the index is mentioned in the checks…
This concerns a PostgreSQL version 15 btw.
>> Are you at the current patch level?
Yes.
Disclaimer <https://www.kbc.com/KBCmailDisclaimer;
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Index (primary key) corrupt?
2025-09-19 09:29 RE: Index (primary key) corrupt? Wim Rouquart <[email protected]>
@ 2025-09-20 15:00 ` Adrian Klaver <[email protected]>
1 sibling, 0 replies; 5+ messages in thread
From: Adrian Klaver @ 2025-09-20 15:00 UTC (permalink / raw)
To: Wim Rouquart <[email protected]>; Ron Johnson <[email protected]>; [email protected] <[email protected]>
On 9/19/25 02:29, Wim Rouquart wrote:
> Internal
>
>>> Does this problem keep happening, or has it only happened once?
>
> It is consistent on this database/index, haven’t noticed it anywhere
> else yet luckily. Seems to be a one-off.
The above is not clear to me. One-off as for this database/index only
and repeatable across dumps or that it only happen in one dump.
> This concerns a PostgreSQL version 15 btw.
>
>>> Are you at the current patch level?
>
> Yes.
Please specify the actual version, current is a relative term. It
matters for folks using this thread for researching an issue in the future.
>
>
> Disclaimer <https://www.kbc.com/KBCmailDisclaimer;
--
Adrian Klaver
[email protected]
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Index (primary key) corrupt?
2025-09-19 09:29 RE: Index (primary key) corrupt? Wim Rouquart <[email protected]>
@ 2025-09-20 15:23 ` David G. Johnston <[email protected]>
2025-09-20 16:26 ` Re: Index (primary key) corrupt? Rob Sargent <[email protected]>
1 sibling, 1 reply; 5+ messages in thread
From: David G. Johnston @ 2025-09-20 15:23 UTC (permalink / raw)
To: Wim Rouquart <[email protected]>; +Cc: Ron Johnson <[email protected]>; [email protected] <[email protected]>
On Friday, September 19, 2025, Wim Rouquart <[email protected]> wrote:
>
> >> Does this problem keep happening, or has it only happened once?
>
>
>
> It is consistent on this database/index, haven’t noticed it anywhere else
> yet luckily. Seems to be a one-off.
>
>
So the problem goes away once you’ve reindexed yet you claim it’s
consistent? What are you doing to get the problem to recur after you’ve
done reindex to make it work?
David J.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Index (primary key) corrupt?
2025-09-19 09:29 RE: Index (primary key) corrupt? Wim Rouquart <[email protected]>
2025-09-20 15:23 ` Re: Index (primary key) corrupt? David G. Johnston <[email protected]>
@ 2025-09-20 16:26 ` Rob Sargent <[email protected]>
2025-09-20 16:58 ` Re: Index (primary key) corrupt? Adrian Klaver <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Rob Sargent @ 2025-09-20 16:26 UTC (permalink / raw)
To: David G. Johnston <[email protected]>; +Cc: Wim Rouquart <[email protected]>; Ron Johnson <[email protected]>; [email protected]
> So the problem goes away once you’ve reindexed yet you claim it’s consistent? What are you doing to get the problem to recur after you’ve done reindex to make it work?
>
> David
I was assuming the OP has a dump of the affected condition and is restoring (and perhaps re-fixing). No?
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Index (primary key) corrupt?
2025-09-19 09:29 RE: Index (primary key) corrupt? Wim Rouquart <[email protected]>
2025-09-20 15:23 ` Re: Index (primary key) corrupt? David G. Johnston <[email protected]>
2025-09-20 16:26 ` Re: Index (primary key) corrupt? Rob Sargent <[email protected]>
@ 2025-09-20 16:58 ` Adrian Klaver <[email protected]>
0 siblings, 0 replies; 5+ messages in thread
From: Adrian Klaver @ 2025-09-20 16:58 UTC (permalink / raw)
To: Rob Sargent <[email protected]>; David G. Johnston <[email protected]>; +Cc: Wim Rouquart <[email protected]>; Ron Johnson <[email protected]>; [email protected]
On 9/20/25 09:26, Rob Sargent wrote:
>
>> So the problem goes away once you’ve reindexed yet you claim it’s consistent? What are you doing to get the problem to recur after you’ve done reindex to make it work?
>>
>> David
>
> I was assuming the OP has a dump of the affected condition and is restoring (and perhaps re-fixing). No?
From this post:
https://www.postgresql.org/message-id/AS2PR05MB107548567EEDAAB3AF74A6C59EF11A%40AS2PR05MB10754.eurpr...
"
> 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.
"
Make of that what you will.
--
Adrian Klaver
[email protected]
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2025-09-20 16:58 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-19 09:29 RE: Index (primary key) corrupt? Wim Rouquart <[email protected]>
2025-09-20 15:00 ` Adrian Klaver <[email protected]>
2025-09-20 15:23 ` David G. Johnston <[email protected]>
2025-09-20 16:26 ` Rob Sargent <[email protected]>
2025-09-20 16:58 ` Adrian Klaver <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox