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.96) (envelope-from ) id 1vurMf-00A4Bw-1N for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Feb 2026 12:18:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vurMe-0012b0-0s for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Feb 2026 12:18:08 +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.96) (envelope-from ) id 1vurMd-0012ar-1E for pgsql-bugs@lists.postgresql.org; Tue, 24 Feb 2026 12:18:07 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vurMa-00000000xHw-0UaI for pgsql-bugs@lists.postgresql.org; Tue, 24 Feb 2026 12:18:06 +0000 Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id C0B70EC05D5; Tue, 24 Feb 2026 07:18:03 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Tue, 24 Feb 2026 07:18:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm2; t=1771935483; x= 1772021883; bh=mWG02IeF6FoPUHxCLAopvxTG1OafCy4rPpUraDC0rZE=; b=M WcQz/fiGqiLgaBYTi5Q9qleBc7ZLScb+P/rZMvfhxF7aObuBSSX1cUGcNgSrKEoF C3E7xYj9bpSVsHPyZpmbYDyFsYJuyFVPywnrPFeDqkyy9pGG5rK54/kZ66yMEDds eMwl4+L8E0IhLwyu04l9TUBQu48lmIHvHbQFiFlGmK7+IGVw0YMlDvqnXa3ifUKZ hv4TIQIMTvqQmfba8K1bUGHrorSQ9ND43hlSx2xesuxXbttL/60Egpq/H16C3IDq AEaECJhlcMOIMf1E9k8ut7h8FRuAGXptB9w3t2Bzmbbd/UQo6UPHpsrnb2s5ZKgE S/tVW0vZyCcW6ni3jU0/g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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 :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1771935483; x=1772021883; bh=m WG02IeF6FoPUHxCLAopvxTG1OafCy4rPpUraDC0rZE=; b=Rh09WdtX3YwUQw6AE 2CbsHZw9fpo8ys8zVECvbVexveN1dmDcuI0FmYB5qJxGYnsQcwI4SKIsi2W1HcV8 CUsW8qJuuQs0epdtv3vB9WCMxFubtyb8Ro7J/KUZWobyFXPHYOKwqXdRLCPjZxLU Krtd5ctdhCf22cUDKb5uIWJo8P88DUyUhtE1Ti7+YnRZ00hmDG6XLppNGlLjRk0y esOt7j+wsZC9VpZMMQMA4wDfHWNvqF0kP61JRxBPmRpWeM2LegsmkjlkIjb1js6S CYYC2D6D1OBN83kjqRbQ/HyaqEBnSbVaXVCvuyHmfNm4Eqx3P59jgW32/+QJb1Cy u7sgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgedtudegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehjohhsvgdrmhhorhgtihhllhhordhvrghlvghntghirghnohes ghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdgsuhhgsheslhhishhtshdrph hoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Feb 2026 07:18:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1771935480; bh=ELLbOM0CfGTnO666Vfgitu2Mh+s2gFtXzUOlNe4CJp0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=r+I8tIZZ/y81j8UgYakOMeHTa80q56TtQ3RiMueHKsjjYLZAMawXqe0+RK2aGSHm3 RmNgbacwBL3rodQZVbY035Sn1iKiCW0EWEPMmOxZaWCJp1blKFU74A6qGfF5dbx3kk uWgUndHfMGWjwlbp9T4RrIIK9H4zG0r5jgb8M7UrPZk391t46RVjYaC2mhD+v4JRVV hO5caysbN8wYsHekPGmRXScLWcO5bEo8Fg5htZYvwZUiEJpeuFbtqRDjq6k1k/Z6vt ZO5bvBUDXK7ODO89pTZTK52IH99mks1F3DzyVPmrZqjaiwwkZYReOupKh2aS2t35W7 LVvme+0lGbDhw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id DD41F78; Tue, 24 Feb 2026 13:18:00 +0100 (CET) Date: Tue, 24 Feb 2026 13:18:00 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: =?utf-8?B?Sm9zw6k=?= Antonio Morcillo Valenciano Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19414: Wrong rows returned by index scan on HASH-partitioned table with PRIMARY KEY (PostgreSQL 16.9) Message-ID: <202602241212.66mpejc6pwpq@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Feb-24, José Antonio Morcillo Valenciano wrote: > Hi! > > After upgrading we reindex all our databases, so I don't see it clear. Oh, sorry, you're right, the problem is potentially not with indexes, but instead it's with the partition key. This would mean that some rows which previously belonged in one partition, should after the upgrade be moved to some other partition due to changes in collation rules. I suspect it's not easy to find such items without fully scanning each partition. Failing that, you would have to recheck the partition constraint for each row in each partition, and move rows across partitions if the partition constraint fails to hold. I don't have a clear idea how to automate this. > The difficulty here is finding a test case to work with. Yes, that is ONE difficulty, but I don't think it's the only one, or even the most difficult one. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ ¡Ay, ay, ay! Con lo mucho que yo lo quería (bis) se fue de mi vera ... se fue para siempre, pa toíta ... pa toíta la vida ¡Ay Camarón! ¡Ay Camarón! (Paco de Lucía)