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 1uzamc-005HVF-4N for pgsql-general@arkaria.postgresql.org; Fri, 19 Sep 2025 13:04:14 +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 1uzama-0076jn-MZ for pgsql-general@arkaria.postgresql.org; Fri, 19 Sep 2025 13:04:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uzamZ-0076jf-UV for pgsql-general@lists.postgresql.org; Fri, 19 Sep 2025 13:04:12 +0000 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uzamV-001hfD-1r for pgsql-general@lists.postgresql.org; Fri, 19 Sep 2025 13:04:11 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 4CB8AEC021B; Fri, 19 Sep 2025 09:04:06 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Fri, 19 Sep 2025 09:04:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1758287046; x=1758373446; bh=QR7ekOgiUtbEkAHKrb9vH5gu0Qn69yo7bTvlhqBWfX0=; b= Ez9cTwkK1bDFJ0/nAAPubSbSFaz1CM7otyAuKD71L1g1ac49U/GPiSNfkSUZoxIb EIeLXRtcT9cv81W5bd27U4ar8bCYTakWiAyad2v3xsxazXsWyXAI/FZ15Mgkb3mq P7rduQmHXvf8FUB9xdFWrFN7vKtM+j5C/zUoVifH+JxDEppERUkuY1MMh84ehLAl J5U8ddZ2QFsKbf4A/ZRODqGLdo6SS5g3UpkehDnxgezGopjhntuqD1t+yykutiwq OE+xqarrVUPlrAxxbHdabWZKDo/MjewP+KNLyWeZ+mKlZ8BPP785d2kx605F9ebY s/vc1r1YZIPCr7S+uKvP6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1758287046; x=1758373446; bh=Q R7ekOgiUtbEkAHKrb9vH5gu0Qn69yo7bTvlhqBWfX0=; b=M/GOqTBp06LM7ONVv qLP2a86Dw3xcSKNQuNAQpESi91BIPEhPKwXoZ/CPr7QsPvc6eKtjzKsdbZZGIBg5 jMgzt5WnUR9xr2tXswY4ciiOl0z7zm30o+m2PyKt3JjMXZfmG0YPslq//MbORxYF sG3PrDor5duCK+YoezZXhvfsrud3KwyqaA9ucTPjznZQT6DJ675ajdOWW2aHIq/p Cjxlzop0gNwwlT4Hkh7FE2BU1v1dRtTa8uN90vfXMAqLWiP2iEpxJZz+fGq+9GFM IFe/1WXkkBnyHkyP9kQr/6L/MR682uDw5QWvBdGNQ9KJoVG1F3Co0hy7jUvWls3I gAH0Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdegledvkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughrihgrnhcu mfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqne cuggftrfgrthhtvghrnhepffelgeeifefgveduhedthfekuedtffejveegffegjeevtdeh gfduieetfeehjeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghr tghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepfihimhdrrhhouh hquhgrrhhtsehksggtrdgsvgdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehl ihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Sep 2025 09:04:04 -0400 (EDT) Message-ID: Date: Fri, 19 Sep 2025 06:04:04 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Index (primary key) corrupt? To: Wim Rouquart , "pgsql-general@lists.postgresql.org" References: <1bfa0b6b-11a8-458f-a3f3-3f86574abc1d@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/19/25 02:40, Wim Rouquart wrote: > Internal > >>> 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? What is the result for the query?: select * from pg_index where indexrelid = 'idx_376814_primary'::regclass; How is the table populated with data? > >> What is the complete pg_dump command being given? > > pg_dump --verbose -p -U -d > 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. > -- Adrian Klaver adrian.klaver@aklaver.com