From: | Greg Sabino Mullane <htamfids(at)gmail(dot)com> |
---|---|
To: | Wim Rouquart <wim(dot)rouquart(at)kbc(dot)be> |
Cc: | 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-12 01:44:34 |
Message-ID: | CAKAnmmLNaQ9NnjP=-kMj4t6wjt3+5nmMbQc2+F2Ekv_=zJWs5w@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Sat, Sep 20, 2025 at 5:07 AM Wim Rouquart <wim(dot)rouquart(at)kbc(dot)be> wrote:
> Name |Value |
> -------------------+-------+
> indexrelid |2006873|
> indrelid |1998823|
> indnatts |1 |
> indnkeyatts |1 |
...
indclass |{} |
>
Hold on, that makes no sense at all. The indkey/indclass columns cannot be
empty, especially as indnkeyatts is 1, as it should be. As a matter of
fact, pg_dump would completely choke on a broken table like this and not
even be able to dump it. But that output is clearly not from psql, so I
think whatever client application you are using is not able to reliably
output array columns. Any chance you can run that select command using
psql? As the rest of the columns look sane, I'm going to guess those are as
well, they just don't show up correctly, and the system catalogs are
uncorrupted.
until I do the rebuild and then the issue is fixed
Could you show us exactly the steps that show the index is missing, and
that it is then fixed?
(ponders) Keep in mind that although you declared the primary key in your
create table statement, pg_dump is going to separate the table creation
from the primary key creation by a lot of lines. So you will see in the
pg_dump output:
CREATE TABLE public.bcf_work_type (
id bigint NOT NULL,
aml_score bigint NOT NULL
);
and then much later on:
ALTER TABLE ONLY public.bcf_work_type
ADD CONSTRAINT idx_376814_primary PRIMARY KEY (id);
Also be aware that if you are using the --section argument, the table will
appear in the 'pre-data' section but the primary key will appear in the
'post-data' section.
Cheers,
Greg
--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support
From | Date | Subject | |
---|---|---|---|
Next Message | Ron Johnson | 2025-10-12 02:56:31 | Re: Option on `postgres` CLI to shutdown when there are no more active connections? |
Previous Message | Vu Le (JData - HN) | 2025-10-12 00:37:57 | Re: Upgrade & Rollback plan: My customer requests rollback via old-version standby (13 ↔ 17) — need community advice |