Re: docs about FKs referencing partitioned tables

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: docs about FKs referencing partitioned tables
Date: 2019-05-23 03:06:34
Message-ID: 20190523030634.GC5870@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2019-05-23 03:30:49 Re: PostgreSQL 12 Beta 1 press release draft
Previous Message Michael Paquier 2019-05-23 01:55:16 Re: Minor typos and copyright year slippage