Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f2ygW-0005Id-Ch for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Apr 2018 12:35:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f2ygV-0002PH-1s for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Apr 2018 12:35:39 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1f2ygT-0002P7-Sz for pgsql-hackers@lists.postgresql.org; Mon, 02 Apr 2018 12:35:38 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f2ygO-0007Pp-Rm for pgsql-hackers@postgresql.org; Mon, 02 Apr 2018 12:35:36 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id ABB5A20F5C; Mon, 2 Apr 2018 08:35:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 02 Apr 2018 08:35:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=QQi5RR xRct8BDkRtBVNFHldD0+DtcqgrEF4p6QWiGP0=; b=mM9c0ppoAQBOk1O/ZSHd88 Sw1HiNyJiLDjvebRN0DEt6DbU8gRj8IO+gdsXK9skBfyHomNcspX0vULmdv2vBqq /wfqcmBWUsojsIhkR+zXrZhG5EfJTimVZOrR8KgkXwgGA4sR4kalqwLej5DX0u36 kwJ+gOD+5g8PBnDLN9e9e4dJWUNjK74Z7xSsIem0fClKFRzUN2NIMALuTEmiag6A rZQWebCCauoApMseU6oqExMDRVqw7Q2tNUUUhYjnNYqQpoO3SPrXoRjbJUmQkIbi 4xZifzp9/ZuGEopkIa++4cE5oi/2OD4kBlEhF6tDL+aGpmChYMIXbv+6tFEiMhHg == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 75B7610252; Mon, 2 Apr 2018 08:35:30 -0400 (EDT) Subject: Re: Foreign keys and partitioned tables To: Alvaro Herrera References: <20180331222109.dwqlafrryaxo2clo@alvherre.pgsql> Cc: Pg Hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Mon, 2 Apr 2018 08:35:29 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180331222109.dwqlafrryaxo2clo@alvherre.pgsql> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/31/18 18:21, Alvaro Herrera wrote: > Yeah, I started by putting what I thought was going to be just ALTER > TABLE in that test, then moved to the other file and added what I > thought were more complete tests there and failed to move stuff to > alter_table. Honestly, I think these should mostly all belong in > foreign_key, right > > - Partitioned tables do not support EXCLUDE or > - FOREIGN KEY constraints; however, you can define > - these constraints on individual partitions. > + Partitioned tables do not support EXCLUDE constraints; > + however, you can define these constraints on individual partitions. > + Also, while it's possible to define PRIMARY KEY > + constraints on partitioned tables, it is not supported to create foreign > + keys cannot that reference them. This restriction will be lifted in a This doesn't read correctly. > + future release. > > - tables and permanent tables. > + tables and permanent tables. Also note that while it is permitted to > + define a foreign key on a partitioned table, declaring a foreign key > + that references a partitioned table is not allowed. > Maybe use "possible" or "supported" instead of "allowed" and "permitted" in this and similar cases. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services