RE: BUG #15724: Can't create foreign table as partition

Stepan Yankevych <stepan_yankevych@epam.com>

From: Stepan Yankevych <Stepan_Yankevych@epam.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Langote <amitlangote09@gmail.com>, Pavan Deolasee <pavan.deolasee@gmail.com>, "stepya@ukr.net" <stepya@ukr.net>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-09-25T06:48:36Z
Lists: pgsql-bugs
Hi Guys!

As far as I can see  the issue has been fixed with following resolution 
Ignore partitions that are foreign tables when creating indexes on partitioned tables (Álvaro Herrera)
Previously an error was thrown on encountering a foreign-table partition, but that's unhelpful and doesn't protect against any actual problem.

But I still can't create Pk on partitioned table

See details: 
SELECT version();
PostgreSQL 11.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit

ALTER TABLE fix_capture.fix_message_json ADD CONSTRAINT fix_message_json_pk PRIMARY KEY (fix_message_id,date_id);
SQL Error [42809]: ERROR: cannot create unique index on partitioned table "fix_message_json"
  Detail: Table "fix_message_json" contains partitions that are foreign tables.

Have I missed something? 

STEPAN YANKEVYCH 
Software Engineering Team Leader 
Software Engineering Manager
OCA 
 
Office: +380 322 424 642 x 58840   Cell: +380 96 915 9551   Email: stepan_yankevych@epam.com 
Lviv, Ukraine   epam.com 
 
 
CONFIDENTIALITY CAUTION AND DISCLAIMER
This message is intended only for the use of the individual(s) or entity(ies) to which it is addressed and contains information that is legally privileged and confidential. If you are not the intended recipient, or the person responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. All unintended recipients are obliged to delete this message and destroy any printed copies. 
 

-----Original Message-----
From: Alvaro Herrera <alvherre@2ndquadrant.com> 
Sent: Thursday, June 27, 2019 20:05
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Langote <amitlangote09@gmail.com>; Pavan Deolasee <pavan.deolasee@gmail.com>; stepya@ukr.net; PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #15724: Can't create foreign table as partition

On 2019-Jun-27, Tom Lane wrote:

> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Pushed to 11 and master.  Thanks!
> 
> Don't actually see any push from here?

Sorry, that was a delayed email on which I had not yet pushed the "send"
keystroke.  The push was yesterday.

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



Commits

  1. Fix partitioned index creation with foreign partitions

  2. Doc: Update documentation on partitioning vs. foreign tables.