RE: Index (primary key) corrupt?

From: Wim Rouquart <wim(dot)rouquart(at)kbc(dot)be>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: Index (primary key) corrupt?
Date: 2025-10-10 12:28:28
Message-ID: AS2PR05MB10754F4A8BC2689D4E637869EEFEFA@AS2PR05MB10754.eurprd05.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Internal

Hi,

Apologies for the late response, had other fish to fry...

In response to your questions:

> What is full(15.x) version of Postgres are you using?

15.14

>Is it the community version or a fork or SaaS?

Standard release indeed, running on RHAT8

> What do you get for queries below?:

>select * from pg_opclass where oid = 3124;

|oid |opcmethod |opcname |opcnamespace|opcowner |opcfamily |opcintype |opcdefault |opckeytype
|3124 |403 |int8_ops |11 |10 |1976 |20 |true |0

>select * from pg_opclass where opcname = 'int8_ops';

|oid |opcmethod |opcname |opcnamespace |opcowner |opcfamily |opcintype |opcdefault |opckeytype|
|3124 |403 |int8_ops |11 |10 |1976 |20 |true |0 |
|10021 |405 |int8_ops |11 |10 |1977 |20 |true |0 |

>> How is the table populated with data?
>>Might be a good idea to find out.

Don't know, and apart from that, there will be no data added anymore to this table, seems this db will remain static (it's only a few rows btw)

> Per a comment from Ron, does this lack of export happen every time you dump the table?

Well, yes, until I do the rebuild and then the issue is fixed.

On 9/19/25 06:23, Wim Rouquart wrote:

>> 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 | |
>

Hmm, when I do the above on 15.14 I get:

-[ RECORD 1 ]-------+-------
indexrelid | 242209
indrelid | 242205
indnatts | 1
indnkeyatts | 1
indisunique | t
indnullsnotdistinct | f
indisprimary | t
indisexclusion | f
indimmediate | t
indisclustered | f
indisvalid | t
indcheckxmin | f
indisready | t
indislive | t
indisreplident | f
indkey | 1
indcollation | 0
indclass | 3124
indoption | 0
indexprs | NULL
indpred | NULL

What is full(15.x) version of Postgres are you using?

Is it the community version or a fork or SaaS?

What do you get for queries below?:

select * from pg_opclass where oid = 3124;

select * from pg_opclass where opcname = 'int8_ops';

>
>> How is the table populated with data?

Might be a good idea to find out.

Per a comment from Ron, does this lack of export happen every time you dump the table?

>
> Same answer as above.
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wim Rouquart 2025-10-10 12:30:04 RE: Index (primary key) corrupt?
Previous Message Rahila Syed 2025-10-10 10:38:43 Re: Alerting on memory use and instance crash