From 3de241dba86f3dd000434f70aebba725fb928032 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 4 Apr 2018 14:02:31 -0300 Subject: Foreign keys on partitioned tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Álvaro Herrera Discussion: https://postgr.es/m/20171231194359.cvojcour423ulha4@alvherre.pgsql Reviewed-by: Peter Eisentraut --- doc/src/sgml/ref/alter_table.sgml | 3 ++- doc/src/sgml/ref/create_table.sgml | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 69f3355eded..bd2262761e8 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -368,7 +368,8 @@ WITH ( MODULUS numeric_literal, REM specified check constraints). But the database will not assume that the constraint holds for all rows in the table, until it is validated by using the VALIDATE - CONSTRAINT option. + CONSTRAINT option. Foreign key constraints on partitioned + tables may not be declared NOT VALID at present. diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 14a43b45e9a..d49899c4971 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -546,9 +546,12 @@ WITH ( MODULUS numeric_literal, REM - 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 + future release. @@ -907,7 +910,9 @@ WITH ( MODULUS numeric_literal, REM must have REFERENCES permission on the referenced table (either the whole table, or the specific referenced columns). Note that foreign key constraints cannot be defined between temporary - tables and permanent tables. + tables and permanent tables. Also note that while it is possible to + define a foreign key on a partitioned table, it is not possible to + declare a foreign key that references a partitioned table. -- cgit v1.2.3