Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v7l99-007PCg-GB for pgsql-general@arkaria.postgresql.org; Sun, 12 Oct 2025 01:45:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v7l96-0002BB-E2 for pgsql-general@arkaria.postgresql.org; Sun, 12 Oct 2025 01:45:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v7l95-0002B2-Sx for pgsql-general@lists.postgresql.org; Sun, 12 Oct 2025 01:45:12 +0000 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v7l94-001HVB-33 for pgsql-general@lists.postgresql.org; Sun, 12 Oct 2025 01:45:11 +0000 Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-42d8ad71a51so35612445ab.1 for ; Sat, 11 Oct 2025 18:45:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760233510; x=1760838310; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rdtT1fxsdJLkil9hktvQiudeXJrpUKgl0mWiUrqUkhE=; b=W7YwgXv74UwSR2weG8zfQewQcIY1pQ8zXJE1Tl+q7YDhBJ7kFxnykfPXJYQ9tmVqjf Ot92KGai/r4hUFkROqIOVrGDKOSPy5g/9ScyQigcgrE/pbWDE2n9i/g4X2l4djDxf4Mj CeBxuclO8Zk808e12m+urf23VVjGbKFBw8GJFZBHxwLS3zDfpoQXswC/2X/J9pdBOKCS bi3fakMZ3/tq/vjcwRIQDpKdP9EWp1fvISPLOePQZE2T+8YB8ql+fvBMARDVlETtPp0O n5yk/eKxnDdNvNQsEzeNkWW21AiYlEfEZ9oUN174I5q4SUmbXVnIUpSd9aiQ4dfLicP5 LCug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760233510; x=1760838310; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rdtT1fxsdJLkil9hktvQiudeXJrpUKgl0mWiUrqUkhE=; b=jiCdF3EMtcb2wt2ltH+/1MMNwLW4EKzSKBfzJ0bina8qhtl9hKBJpYE5vURoJi4fh4 vhhqktCjN66pyAvVw7sQSTNa5LfoHkiAjE54AC3XL/kA+8ovME7k3NKd+ZMIrsw5Zlwd u9nbaf9gzuqUO7SinK+GnBs+dyco/zKX9fdj3RjmZZQYlugR6PYTZgeFBsZc4+QF5nyS JP0/u4oukJSZQpoHUBYnBb0sIbD2YWAgFJmvJBn046b87GLUEuuPqwiUvRaiUkmxfejS iAOVW0QGiq8HMMFNohjrYVY9mON+9oHAvp6MAc81vDvdW/BKBxpCmmFbNNTCBihllgLy uKHg== X-Forwarded-Encrypted: i=1; AJvYcCWta+HbfR3PRLU2SSmVqOSMR3HM6WDlr8CokjC62P29ZI+xZqZ+1jW/SQglfGXeGkm4iezRft4ZYwvfhDUi@lists.postgresql.org X-Gm-Message-State: AOJu0Yx8MOZwyAMzYSUQ70HnP4WyXlBk9smuoi60wjrk5El+FpsIv9U/ sFdVFgmqSXPUCi5l0aNHTlMqZ34OAnWUCUKKZnnQ1ZGkiidc+9SN2EddjJXvkPmWxtJ4BPk52R9 n4SI7y0jnZDpCWgPGvNIMAktVz7juQB4= X-Gm-Gg: ASbGncuaA355dZxXbvfNdUzDsjd6PfMFmU+jP0uOh0HDMNufasvVbt9nbE7gXC+qiOE ZoWZqvup5ZGfKGj6Pve5ERHjUr8nnPD4/b9qwzoc4yvDqbaDS1H3es4zrmd7NX37EOM7kZTDGeI MQHC8kuDefYCj2iGK/sqBYz7DU/7L4AWtWtiislAafiA0BWhQt2SvqedPz6lwqL4h4sN9cZOBUs FlrC4x6co5V0W87xE0kmPWGrqAqDaG183nklaQ5+RLNU3fPduWkgy9zng1rteN7lVthjrkSkmHz sYpP X-Google-Smtp-Source: AGHT+IEVh9/8b52XsIEcJbQ5YlcP9VXwg5Pfde/X9CmTO0vLeYY7nv6hPKGCwOjZHQce+k7g8QWH/e2Fw22/Bi2ofnM= X-Received: by 2002:a05:6e02:3a05:b0:42f:8ee2:1eb8 with SMTP id e9e14a558f8ab-42f8ee2204bmr174772145ab.11.1760233509993; Sat, 11 Oct 2025 18:45:09 -0700 (PDT) MIME-Version: 1.0 References: <1bfa0b6b-11a8-458f-a3f3-3f86574abc1d@aklaver.com> In-Reply-To: From: Greg Sabino Mullane Date: Sat, 11 Oct 2025 21:44:34 -0400 X-Gm-Features: AS18NWCrptB7HqLFYRxW21vaN-CpWuKkOhiBJm7sAEavtGisy31zNA4X99skDac Message-ID: Subject: Re: Index (primary key) corrupt? To: Wim Rouquart Cc: Adrian Klaver , "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="00000000000015c4c40640ec4dea" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000015c4c40640ec4dea Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Sep 20, 2025 at 5:07=E2=80=AFAM Wim Rouquart = 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 --00000000000015c4c40640ec4dea Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Sep 20, 2025 at 5:07=E2=80=AFAM W= im Rouquart <wim.rouquart@kbc.be<= /a>> wrote:
Name=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|Value=C2=A0 | -------------------+-------+
indexrelid=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|2006873|
indrelid=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|1998823|
indnatts=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|1=C2=A0 =C2=A0 =C2=A0 | indnkeyatts=C2=A0 =C2=A0 =C2=A0 =C2=A0 |1=C2=A0 =C2=A0 =C2=A0 |=C2=A0
...
indclass=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0|{}=C2=A0 =C2=A0 =C2=A0|

<= /div>
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 matt= er of fact, pg_dump would completely choke=C2=A0on a broken=C2=A0table like= this and not even be able to dump it. But that output is clearly not from = psql, so I think whatever client application=C2=A0you are using is not able= to reliably output array=C2=A0columns. 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 sys= tem catalogs are uncorrupted.

until I do the rebuild and then the issue is fixed=

Could you show us exactly the steps that s= how the index is missing, and that it is then fixed?

(ponders) Keep in mind that although you declared the primary key in you= r create table statement, pg_dump is going to separate the table creation f= rom the primary key creation by a lot of lines. So you will see in the pg_d= ump output:

CREATE TABLE public.bcf_work_type (=C2=A0 =C2=A0 id bigint NOT NULL,
=C2=A0 =C2=A0 aml_score bigint NOT NU= LL
);

and then much later on:

ALTER TABLE ONLY public.bcf_work_type
=C2=A0 =C2=A0 ADD CONSTRAI= NT idx_376814_primary PRIMARY KEY (id);

Also be aw= are 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
=
--00000000000015c4c40640ec4dea--