Re[2]: BUG #15724: Can't create foreign table as partition

From: Stepan Yankevych <stepya(at)ukr(dot)net>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re[2]: BUG #15724: Can't create foreign table as partition
Date: 2019-03-29 14:21:15
Message-ID: 1553869152.858391073.5f8m3n0x@frv53.fwdcdn.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


I think we need at least to mention it in the dochttps://www.postgresql.org/docs/11/ddl-partitioning.html

>> Partitions can also be foreign tables, although they have some limitations that normal tables do not; see CREATE FOREIGN TABLE for more information
For example  
  Partitions can also be foreign tables only in case main table is non indexed and doesn't contain PK, although they have some limitations that normal tables do not; see CREATE FOREIGN TABLE for more information

--- Original message ---
From: "Alvaro Herrera" <alvherre(at)2ndquadrant(dot)com>
Date: 29 March 2019, 16:11:04

On 2019-Mar-29, Tom Lane wrote:

> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > On 2019-Mar-29, PG Bug reporting form wrote:
> >> SQL Error [42809]: ERROR: cannot create index on foreign table "msg_json"
>
> > Ah, this is because we try to propagate the index to the partition,
> > which appears to be less than desirable. Maybe this patch fixes it? I
> > have not tested it, only verified that it compiles.
>
> Really, what *ought* to happen in such a case is that the FDW gets
> told about the command and has the opportunity to try to do something
> corresponding to making an index. But that smells like a new feature
> rather than a bug fix.

ENOTIME to get it done for pg12 I suppose (I don't know a thing about
postgres_fdw or the FDW API layer).

> I'm not sure that just forcing the case to be a no-op is wise.
> What if the index is supposed to be UNIQUE?

Hmm, good point, that should be disallowed too.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stepan Yankevych 2019-03-29 16:25:42 Re[2]: BUG #15724: Can't create foreign table as partition
Previous Message Tom Lane 2019-03-29 14:14:44 Re: BUG #15723: Export fails 'worker process died unexpectedly' but no error in pg_dump