Re: FK v.s unique indexes - Mailing list pgsql-general

From David Rowley
Subject Re: FK v.s unique indexes
Date
Msg-id CAKJS1f8qhOUwrirekdvNEYniUzUN1XRrHKJvs8sSL4VFi8vHuQ@mail.gmail.com
Whole thread Raw
In response to FK v.s unique indexes  (Rafal Pietrak <rafal@ztk-rp.eu>)
Responses Re: FK v.s unique indexes  (Rafal Pietrak <rafal@ztk-rp.eu>)
Re: FK v.s unique indexes  (pinker <pinker@onet.eu>)
List pgsql-general
On 3 July 2018 at 19:30, Rafal Pietrak <rafal@ztk-rp.eu> wrote:
> tst=# create table test1(load bigint, a int, b int, c bool) partition by
> list (c);
> CREATE TABLE
> tst=# create table test1_true  partition of test1 for values in (true);
> CREATE TABLE
> tst=# create table test1_false  partition of test1 for values in (false);
> CREATE TABLE
> tst=# create unique index load ON test1 (load,a,b,c);
> CREATE INDEX
> tst=# create table info_text1 (load text, a int, b int, c bool, info
> text,  foreign key (load,a,b,c) references test1(load,a,b,c)) ;
> ERROR:  cannot reference partitioned table "test1"
> ----------------------------------
>
> Why is this forbidden?

I don't think there were any actual roadblocks, it was more of just
not enough time in the cycle to make it work due to a few technical
details that required extra effort to make work.

Alvaro managed to simplify the problem and allow foreign keys to be
defined on partitioned tables and get that into PG11.

So it was a case of 50% is better than 0%, which I very agree with.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-general by date:

Previous
From: pinker
Date:
Subject: Re: except all & WITH - syntax error?
Next
From: TAKATSUKA Haruka
Date:
Subject: Re: Windows 10 got stuck with PostgreSQL at starting up. Addingdelay lets it avoid.