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 1sJa3t-005hbX-Aw for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2024 14:43:53 +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 1sJa3r-00EXH7-0z for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2024 14:43:51 +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 1sJa3q-00EXGt-Kf for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2024 14:43:51 +0000 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJa3k-002Iev-Rh for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2024 14:43:50 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 6DCC41380086; Tue, 18 Jun 2024 10:43:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 18 Jun 2024 10:43:43 -0400 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1718721823; x= 1718808223; bh=Ln99y6MQp3muGoE8T36i+QEjyB+ro8gHBEJgdNRHlvs=; b=X T9cLaONvJ3LEvqb2ukFgt2Gw7ZjA8EL2ZLZIkoIaSQidWdI9s4fwaTeh8zszXbyE B1h3QWFgv9yUQS9UczjRKK7lF8Bu6nLU2DiPgTH56z91jOfRdtsNncOpMYYrkXqJ MkYknzuzjwjxO8AVlY7MU/QXOGerqFkkX4ipOSvvpTkBwMhTMnOfayqyewySC0fm s05iGF3LECvoklKUkSWhC8071/1APtaPCxboMkjOIGY68638bdzVqvXQhjUExPBP SkcXgxGa/LsosfQb2QVae+NfZTOV/MLcgOhEwHJfYtxbwbjRlumBxAFY95hg1GlG kVy5Ecb7sMsAFyy3u28TA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedvkedgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jun 2024 10:43:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1718721820; bh=LmEMCTDPQ7esMDNq4KIu4vn0cpwLi6c9QyJND65Xvr0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=H5W5/gZOdt6+vuhkywppQTR6wp49Tvt5CZ8uCBW6Pxma00GOciRIgmLUCMMCrgWSS qoJd14k95T3MlBlEQ22VnQ5Fq8Rg4bG3AhVaAoEPPTFwtayOUHKWwF4YyQ5u4Pb3x6 UQ3LMsU027/LPBmh21gVh8RRo9IujH5KrG8cPbO44AOTgrx1hhc29KYZheC+kLICzT SKEeIYDqCPJC9ZIZdRwFntf6Gx2mtwc/3nW1e7lG0tk3O9UfSArmOxWCMKrahbAHpK agzamYRL1uZyBGe23aoMab5QP0A1uHwRY6SlSJAHsXwxAOPBufpWvNETrXWytvOhia BwGfggifcVKfw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id C8D19527; Tue, 18 Jun 2024 07:43:40 -0700 (PDT) Date: Tue, 18 Jun 2024 16:43:40 +0200 From: Alvaro Herrera To: Philipp Faster Cc: "pgsql-general@lists.postgresql.org" Subject: Re: How to attach partition with primary key Message-ID: <202406181443.ykwubo4pecdp@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 2024-Jun-18, Philipp Faster wrote: > I've done a bad job describing my issue in the first place: I left out a > key definition statement that I thought doesn't play any role in the issue: > another unique index on the same columns as PK. I see. That unique index seems quite useless. Why not just drop it? That would also solve your problem. > Interesting thing is that if I define PK before the unique index and then > drop it and redefine after the unique index, then the code still doesn't > work. This behaviour smells like a bug on the PostgreSQL side... Yeah, it sounds like we have a bug in the index-matching code, though it depends on having a useless, duplicative index. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Selbst das größte Genie würde nicht weit kommen, wenn es alles seinem eigenen Innern verdanken wollte." (Johann Wolfgang von Goethe) Ni aún el genio más grande llegaría muy lejos si quisiera sacarlo todo de su propio interior.