Re: Table Inheritance and Foreign Keys - Mailing list pgsql-general

From Tom Lane
Subject Re: Table Inheritance and Foreign Keys
Date
Msg-id 8781.1550444335@sss.pgh.pa.us
Whole thread Raw
In response to Table Inheritance and Foreign Keys  ("Riaan Stander" <rstander@exa.co.za>)
List pgsql-general
"Riaan Stander" <rstander@exa.co.za> writes:
> I've got a scenario where I'm building a table structure that allows for
> building a tree. In order to properly separate the different column
> requirements I've looked at using table inheritance.
> [ but can't point a foreign key at an inheritance tree ]
> My question is if anybody knows more as to if and when this actually will be
> allowed/solved.

Don't hold your breath :-(.  It's been like that for decades.

We do, as of v11, support foreign keys referencing partitioned tables,
but that relies on the ability to declare a unique constraint across
a partitioned table, which in turn relies on there being a known
partitioning key (which has to be part of the unique column set).

Generic inheritance doesn't have that much semantic knowledge about
how the data is divvied up, so it's not really practical to support
these things in a generic inheritance tree.

Probably we should revise that bit of documentation to point people
at the partitioning features; I doubt anything's ever going to be
done about this for generic inheritance.

            regards, tom lane


pgsql-general by date:

Previous
From: "Riaan Stander"
Date:
Subject: Table Inheritance and Foreign Keys
Next
From: Michael Paquier
Date:
Subject: Re: Channel binding not supported using scram-sha-256 passwords