From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: stepya@ukr.net
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15724: Can't create foreign table as partition
Date: Fri, 21 Jun 2019 11:49:15 -0400
Message-ID: <20190621154915.GA17031@alvherre.pgsql> (raw)
In-Reply-To: <CABOikdP5KPfJOpWVtU-XvHoXbHYntJ47+sCf_r6Z5WRCZsArFg@mail.gmail.com>
On 2019-Jun-21, Pavan Deolasee wrote:
> 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.
I don't oppose making such a change in pg13, but it seems too much of a
behavior change to be making even in pg12, let alone in the stable
branches.
Therefore, my proposal --in response to this bug report-- is to
backpatch the previously proposed patch, which allows indexes to be
created [on partitioned tables containing foreign tables as partitions],
as long as they are not UNIQUE/PKs.
If others want to explore the implications of UNIQUE/PK indexes on
partitioned tables with foreign partitions, I won't stand in their way,
though it doesn't seem material for this thread.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: alvherre@2ndquadrant.com, pavan.deolasee@gmail.com, stepya@ukr.net, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15724: Can't create foreign table as partition
In-Reply-To: <20190621154915.GA17031@alvherre.pgsql>
* 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