Re: docs about FKs referencing partitioned tables - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: docs about FKs referencing partitioned tables
Date
Msg-id 20190523030634.GC5870@paquier.xyz
Whole thread Raw
In response to Re: docs about FKs referencing partitioned tables  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
Responses Re: docs about FKs referencing partitioned tables  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-hackers
On Mon, May 20, 2019 at 10:35:31PM -0700, Paul A Jungwirth wrote:
> I agree that sounds better. To avoid repeating it I changed the second
> instance to just "inherited tables". New patch attached.

Looking closer, you are adding that:
+     <listitem>
+      <para>
+       While primary keys are supported on tables using inheritance
+       for partitioning, foreign keys referencing these tables are not
+       supported.  (Foreign key references from an inherited table to
+       some other table are supported.)
+      </para>
+     </listitem>

However that's just fine:
=# create table aa (a int primary key);
CREATE TABLE
=# create table aa_child (a int primary key, inherits aa, foreign key
(a) references aa);
CREATE TABLE
=# create table aa_grandchild (a int primary key, inherits aa_child,
foreign key (a) references aa_child);
CREATE TABLE

The paragraph you are removing from 5.11.2.3 (limitations of
declarative partitioning) only applies to partitioned tables, not to
plain tables.  And there is no such thing for paritioning based on
inheritance, so we should just remove one paragraph, and not add the
extra one, no?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Minor typos and copyright year slippage
Next
From: "Jonathan S. Katz"
Date:
Subject: Re: PostgreSQL 12 Beta 1 press release draft