pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Riaan Stander <rstander@exa.co.za>
Cc: pgsql-general@postgresql.org
Subject: Re: Table Inheritance and Foreign Keys
Date: Sun, 17 Feb 2019 17:58:55 -0500
Message-ID: <8781.1550444335@sss.pgh.pa.us> (raw)
In-Reply-To: <003501d4c70d$b7a8c3e0$26fa4ba0$@exa.co.za>
References: <003501d4c70d$b7a8c3e0$26fa4ba0$@exa.co.za>

"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




view thread (6+ messages)

Message-ID: <8781.1550444335@sss.pgh.pa.us>
Permalink:  ../8781.1550444335@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8781.1550444335@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rstander@exa.co.za
  Subject: Re: Table Inheritance and Foreign Keys
  In-Reply-To: <8781.1550444335@sss.pgh.pa.us>
  References: <003501d4c70d$b7a8c3e0$26fa4ba0$@exa.co.za> <8781.1550444335@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox