Re: BUG #15724: Can't create foreign table as partition - Mailing list pgsql-bugs

From Pavan Deolasee
Subject Re: BUG #15724: Can't create foreign table as partition
Date
Msg-id CABOikdP5KPfJOpWVtU-XvHoXbHYntJ47+sCf_r6Z5WRCZsArFg@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15724: Can't create foreign table as partition  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: BUG #15724: Can't create foreign table as partition
List pgsql-bugs
On Thu, Jun 20, 2019 at 6:07 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:


With this patch, an index creation will no longer fail in the presence
of a partition that is a foreign table, as long as the index is not a
constraint index (not unique, not primary key).  Conversely,
creating/attaching a partition that is a foreign table does not fail if
the partitioned table only has non-constraint indexes.


Like others suggested above, I also think that we should make this is a no-op on the foreign tables i.e. not fail even when there exists a UNIQUE or PRIMARY KEY on the parent table. We simply assume that the appropriate constraints will be defined on the foreign side and violations will be caught. This is same as CHECK constraints on the foreign partitions, that we assume the foreign server will enforce. 

Thanks,
Pavan

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

pgsql-bugs by date:

Previous
From: "Rozboril, Robert"
Date:
Subject: RE: PostgreSQL v11.3 - Records are deleted from child table ifpartition key of parent table is changed
Next
From: Pavel Stehule
Date:
Subject: Re: segfault during SELECT using && ANY (ARRAY[NULL]::BOX2D).