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 1hkgWv-0005AP-RI for pgsql-docs@arkaria.postgresql.org; Tue, 09 Jul 2019 03:10:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hkgWu-00020X-6v for pgsql-docs@arkaria.postgresql.org; Tue, 09 Jul 2019 03:10:56 +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 1hkgWu-00020Q-00 for pgsql-docs@lists.postgresql.org; Tue, 09 Jul 2019 03:10:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkgWs-0000jU-0Q for pgsql-docs@lists.postgresql.org; Tue, 09 Jul 2019 03:10:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x693ApFj018802; Mon, 8 Jul 2019 23:10:51 -0400 From: Tom Lane To: Michael Paquier cc: Bruce Momjian , phil.bayer@gmail.com, pgsql-docs@lists.postgresql.org, PostgreSQL-development Subject: Re: Postgres 11: Table Partitioning and Primary Keys In-reply-to: <20190709025856.GC1345@paquier.xyz> References: <156236160709.1192.4498528196556144085@wrigleys.postgresql.org> <20190709023737.vhrd4pxe4hgnd3ks@momjian.us> <20190709025856.GC1345@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Tue, 09 Jul 2019 11:58:56 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18800.1562641851.1@sss.pgh.pa.us> Date: Mon, 08 Jul 2019 23:10:51 -0400 Message-ID: <18801.1562641851@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > Attached is an idea of patch for the documentation, using this > wording: > + > + > + When defining a primary key on a partitioned table, the primary > + key column must be included in the partition key. > + > + Isn't it the other way around, that the partition key column(s) must be included in the primary key? Maybe I'm confused, but it seems like we couldn't enforce PK uniqueness otherwise. regards, tom lane