PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15724
PG Version11.1
OSCentOS Linux release 7.5.1804 (Core)
Opened2019-03-29 12:55:15+00
Reported byStepan Yankevych
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15724
Logged by:          Stepan Yankevych
Email address:      (redacted)
PostgreSQL version: 11.1
Operating system:   CentOS Linux release 7.5.1804 (Core)
Description:        

I have two DB 
big_data - PG 11.1
big_data_arch - PG 11.1

On the big_data DB i have following table 

CREATE TABLE msg_json
(   msg_id bigint NOT NULL DEFAULT
nextval('msg_json_msg_id_seq'::regclass),
    date_id integer NOT NULL,
    msg json
    CONSTRAINT pk_msg_json PRIMARY KEY (date_id, msg_id) ) PARTITION BY
RANGE (date_id) 
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;


CREATE INDEX msg_json_cross_order_id_idx
    ON msg_json USING btree
    (get_jsn_cross_order_id(msg) COLLATE pg_catalog."default")
    TABLESPACE ssd_ts;


CREATE INDEX msg_json_msg_id_idx
    ON msg_json USING btree
    (msg_id, date_id)
    TABLESPACE ssd_ts;

-- Partitions SQL

CREATE TABLE msg_json_20180102 PARTITION OF msg_json
    FOR VALUES FROM (20180102) TO (20180103);

CREATE TABLE msg_json_20180103 PARTITION OF msg_json
    FOR VALUES FROM (20180103) TO (20180104);
...
until today

On the big_data_arch
 I have the same table with the same name, structure and indexes in the
fix_capture schema but containing 2017 year data.

On the big_data DB i run following

CREATE FOREIGN TABLE staging.msg_json PARTITION of msg_json  
    FOR VALUES FROM (20170101) TO (20180101)
    SERVER postgres_big_data_arch
    OPTIONS (schema_name 'fix_capture', table_name 'msg_json');


I got error !!!!

SQL Error [42809]: ERROR: cannot create index on foreign table "msg_json"
  ERROR: cannot create index on foreign table "msg_json"
  ERROR: cannot create index on foreign table "msg_json"


I tried to import foreign table into staging schema and then attach
partition. 
Import looks good. Foreign table contains data and i can query it through
fdw.
But running 
ALTER TABLE msg_json ATTACH PARTITION staging.msg_json FOR VALUES FROM
(20170101) TO (20180101);
Brings me the same error!!!. 

Thanks!

Messages

DateAuthorSubject
2019-03-29 12:55:15+00PG Bug reporting formBUG #15724: Can't create foreign table as partition
2019-03-29 13:55:19+00Alvaro HerreraRe: BUG #15724: Can't create foreign table as partition
2019-03-29 14:01:31+00Tom LaneRe: BUG #15724: Can't create foreign table as partition
2019-03-29 14:10:50+00Alvaro HerreraRe: BUG #15724: Can't create foreign table as partition
2019-03-29 14:21:15+00Stepan YankevychRe[2]: BUG #15724: Can't create foreign table as partition
2019-03-29 16:25:42+00Stepan YankevychRe[2]: BUG #15724: Can't create foreign table as partition
2019-04-01 05:35:28+00Etsuro FujitaRe: BUG #15724: Can't create foreign table as partition
2019-04-01 06:01:50+00Etsuro FujitaRe: BUG #15724: Can't create foreign table as partition
2019-04-01 06:23:15+00Amit LangoteRe: BUG #15724: Can't create foreign table as partition
2019-04-01 06:40:49+00Etsuro FujitaRe: BUG #15724: Can't create foreign table as partition
2019-04-01 06:45:14+00Amit LangoteRe: BUG #15724: Can't create foreign table as partition
2019-04-01 06:57:29+00Etsuro FujitaRe: BUG #15724: Can't create foreign table as partition
2019-04-05 12:07:47+00Etsuro FujitaRe: BUG #15724: Can't create foreign table as partition
2019-06-20 00:36:44+00Alvaro HerreraRe: BUG #15724: Can't create foreign table as partition
2019-06-21 06:37:54+00Pavan DeolaseeRe: BUG #15724: Can't create foreign table as partition
2019-06-21 15:49:15+00Alvaro HerreraRe: BUG #15724: Can't create foreign table as partition
2019-06-25 08:56:00+00Amit LangoteRe: BUG #15724: Can't create foreign table as partition
2019-06-25 12:56:57+00Alvaro HerreraRe: BUG #15724: Can't create foreign table as partition
2019-06-26 05:50:49+00Amit LangoteRe: BUG #15724: Can't create foreign table as partition
2019-06-26 20:18:43+00Alvaro HerreraRe: BUG #15724: Can't create foreign table as partition
2019-06-27 16:33:32+00Alvaro HerreraRe: BUG #15724: Can't create foreign table as partition
2019-06-27 16:47:50+00Tom LaneRe: BUG #15724: Can't create foreign table as partition
2019-06-27 17:04:41+00Alvaro HerreraRe: BUG #15724: Can't create foreign table as partition
2019-09-25 06:48:36+00Stepan YankevychRE: BUG #15724: Can't create foreign table as partition
2019-09-25 07:43:46+00Etsuro FujitaRe: BUG #15724: Can't create foreign table as partition