Re: FK v.s unique indexes

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Rafal Pietrak <rafal(at)ztk-rp(dot)eu>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: FK v.s unique indexes
Date: 2018-07-03 09:23:56
Message-ID: CAKJS1f8qhOUwrirekdvNEYniUzUN1XRrHKJvs8sSL4VFi8vHuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3 July 2018 at 19:30, Rafal Pietrak <rafal(at)ztk-rp(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message TAKATSUKA Haruka 2018-07-03 10:01:47 Re: Windows 10 got stuck with PostgreSQL at starting up. Adding delay lets it avoid.
Previous Message pinker 2018-07-03 09:05:59 Re: except all & WITH - syntax error?