Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkjin-0004AD-BW for pgsql-docs@arkaria.postgresql.org; Tue, 09 Jul 2019 06:35:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hkjim-0002dU-5I for pgsql-docs@arkaria.postgresql.org; Tue, 09 Jul 2019 06:35:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkjik-0002Xu-MX for pgsql-docs@lists.postgresql.org; Tue, 09 Jul 2019 06:35:23 +0000 Received: from [64.147.123.25] (helo=wout2-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkjig-0002ig-E5 for pgsql-docs@lists.postgresql.org; Tue, 09 Jul 2019 06:35:22 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id C5C1C3BA; Tue, 9 Jul 2019 02:34:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 09 Jul 2019 02:34:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=V+nsJnJHIr+mNwf0ZfRfkNABC6U lquV4tf1OQMMTmGY=; b=oSm+NK3wEs5vEA/09IGu3BjhcLiWm8pSYolvdOH2n1+ v3DPRVadCH8+BECv7rfFKKbmX7Fbvbt4N0orIUBnPMEVheKIIW+44vETGCJrDhUr uJiQHgWXkH8DdXjueActYDS3WjLte5rsVZ1zi6371EDApSpXWz22WFdQIBc0bs4P 61WNNSUszungF4k1IaXR+/3duJlpXTGZtVmhcZHKDXgtHr/4zKs4G67QGgyzn5PD cTx1EhuxbrjZJSveXpHa67qQWhnOPVDg6SAuO6jSn7lNC4rnVEfd0EcRJs7vATIk W/6UQt9ObE8LGecaakpr0YfR8/bN5S4c1h7Ga0aZnGA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=V+nsJn JHIr+mNwf0ZfRfkNABC6UlquV4tf1OQMMTmGY=; b=OA4M5z+yYuKBfxxCmMSro3 1gcITra+0BPODNIj3VNU7FNDv68g7tsH9b+vRmEtbpsz3IUxUyOGxn9FS1mMl2eA GRPpLdtrpee6l13j2j4/Z/kxt52kxyHWDpDbvAKbeMBsHV+2Sn2+tSJEVTbhn7qJ 4oOyaZ8IOuOm3GjSfujrqMVr6RfnehEoCPwjQ14S7nyADezMBmn0EkAppovzHiem KR+U79984C07vHHsOGD5x/tbCdHAG8EcP+whqwto9mF4cL5bPMOPJeN0xf8dPwFc v7e6Myv35jzojYbHtaJUCZIBfTEA/hZRHTuzQJYf2WQg0hbInR3Zu3NSQH76uy/w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrgedugddutdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepudduuddruddtvddrudektddrudekheenucfrrghr rghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 7329980061; Tue, 9 Jul 2019 02:34:53 -0400 (EDT) Date: Tue, 9 Jul 2019 15:34:48 +0900 From: Michael Paquier To: "David G. Johnston" Cc: Bruce Momjian , phil.bayer@gmail.com, pgsql-docs@lists.postgresql.org, PostgreSQL-development Subject: Re: Postgres 11: Table Partitioning and Primary Keys Message-ID: <20190709063448.GB23827@paquier.xyz> References: <156236160709.1192.4498528196556144085@wrigleys.postgresql.org> <20190709023737.vhrd4pxe4hgnd3ks@momjian.us> <20190709025856.GC1345@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TRYliJ5NKNqkz5bu" Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.25 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 08, 2019 at 08:12:18PM -0700, David G. Johnston wrote: > Reads a bit backward. How about: >=20 > "As uniqueness can only be enforced within an individual partition when > defining a primary key on a partitioned table all columns present in the > partition key must also exist in the primary key." Yes, I was not really inspired on this one. Looking closely at the code in DefineIndex() (and as Rajkumar has mentioned upthread for unique constraints) this can happen for primary keys, unique constraints and exclusion constraints. So we had better mention all three of them. I am not sure that we need to be explicit about the uniqueness part though, let's say the following: "When defining a primary key, a unique constraint or an exclusion constraint on a partitioned table, all the columns present in the constraint definition must be included in the partition key." -- Michael --TRYliJ5NKNqkz5bu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl0kNYgACgkQnvQgOdby QH2+9Q//WJnB5VQj3X23bkYOtzoVdAX7Q8X7DKw44PjnZ66AijvNYiFV7/ZjTCT5 j4LEVgSltGEj62ZGSWcvHdJ1oyFY5j71TyNcU4V4BOWoohAoXS8lJ0hXWtICO74e FltQjnfBuDi6owPsLrgr0qiT607nEnirX2s2CWEWlUi1SXVZenxzkMp6uAsi9ASh JI6k4BDHLO7OXyzqAe/G1iqYtT8byIBlowiTOPhj0Ei9+oqd6jJLTajYrdPuDcXX d5mXJ5ORDY/UWKeTWh8NQxRqa0uDYSG8x67x68EcnJE0/PayUi0yTMd3eRUT9EGh T3opWb5UNxMFtp9mNQIwqD29KXp590x1kJOHy6ShHOgjB8b/F12jwET0Xq7wBKhd WS3E2cPv3zFdWv9xS63hTyluig7+V+r13ZC/uTmywZqalRGBKRupjLZEUupuYG+N hhDZPzhbzSR/BS7akn572X6e8HpgyftoHgRydYo1QLJTGHK3//hGTgobqFTH0KcA nWLff6kgbgvtGL/1tSZH8Rs2ARcDt8fvUGnlOZ7O5zD7X/GPGBjDqM9nAStFYyn1 EAOrR/LjvsvQl+Wh2zTHhFrUWFnssYdnDsBHj6AdoBffl6rIdulD8NOESSpDS+PV mjSeAfDSOHHCTM0QdfdVOFJM5Ufvpn+7Bg9C6qvGQc5Sczlvg3E= =CNMS -----END PGP SIGNATURE----- --TRYliJ5NKNqkz5bu--