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 1sJVQE-005GAf-H9 for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2024 09:46:38 +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 1sJVQ9-00Adx5-Q6 for pgsql-general@arkaria.postgresql.org; Tue, 18 Jun 2024 09:46:34 +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 1sJVQ9-00Adwx-3z for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2024 09:46:34 +0000 Received: from fhigh4-smtp.messagingengine.com ([103.168.172.155]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJVQ7-002GRY-9Q for pgsql-general@lists.postgresql.org; Tue, 18 Jun 2024 09:46:33 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 2962911402B5; Tue, 18 Jun 2024 05:46:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 18 Jun 2024 05:46:29 -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=1718703989; x= 1718790389; bh=JkBNXwNUk7nXGNNhz2qd4Svu0fKdrdDyIH2bolwyOjI=; b=Q LsINQqkZRdZd7pHoRaCO9zToOFiXYQQ8HekT+bJZCdjwtjyCyX/WmdACTYEZMczp g4f2H2j/1/8q6At2NJuvFQJWZsYJXETHQpyfUDxJ98mm7soesOZa8iAIKgwTg3QV 1xq8zJeSI+q1EozsiyGoXBdt7k2SjltRf5fsp5/H34Ee0kCtccNF9L8eDQ6pgYB9 l4gvZJQs8A3WeWDJzuFo7x2iBvz32hKm7iPQ4w21JYz1eRLeNzBCQsiJijnElMJH UJBfEphsAlPRXtt5bDdgnCZMdEjM/oXk7oTckfE5VGuhMZ6UejRepREHYdPWCfGy z+oPjnE3qYpyNyI5AmzIQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedvjedgudekucetufdoteggodetrfdotf 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 05:46:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1718703987; bh=nuqXFc/KSNKeXG6BuS7BVvxn0j89y6NhClk0K9MRcNA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Ie5Zd0/IVS6ncXv3qnXsxTQTaQqiv8kQoIjHNJW8dfwfh8pMKicp/E2o4IfrGQcl3 kc/dUny7cPpo0Y4ne6Jf+u2Nz6tB4WWgP1DjepbiEcQafwv6OxbkW5I6CDwNYHIeeD VoU8aNS3wxdz7kfI+A+S2sCqUAalsaZKbJqKFv8JwwFJz89XSlzSt2snBdmHctfFQU fqdyV8zBYQUxTX22evbqYVucGgeumnZwu+DDkse04/OxGIPLhwGi1Tzs9NOFe3oABR +9rtpTZHzScaLpUpaca5Yv9HCy1GyHCidaKxjsDuUjmoPWEBKd3w+pgdP1qZBBthqr 3evf6sjK4sN5w== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 91A31527; Tue, 18 Jun 2024 02:46:27 -0700 (PDT) Date: Tue, 18 Jun 2024 11:46:27 +0200 From: Alvaro Herrera To: Philipp Faster Cc: "pgsql-general@lists.postgresql.org" Subject: Re: How to attach partition with primary key Message-ID: <202406180946.d2f3oktuoyps@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: > As I understand, PostgreSQL refuses to use existing primary key for > some reason and tries to create its own as a children of > "Transactions" table's primary key. Yeah. Your case sounds like the primary key in the partitioned table has some slight definition difference from the stock one, which makes the one you create in the partition not an exact match. I'd suggest to look at what "pg_dump -s" emits as definition of the table with a magnifying glass to search for such differences. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/