ri.sql

application/sql

Filename: ri.sql
Type: application/sql
Part: 0
Message: Re: Proposal: Cascade REPLICA IDENTITY changes to leaf partitions
drop table if exists test_ri;
create table test_ri (a int primary key, b integer not null) partition by range(a);
create table test_ri_1 (like test_ri);
create table test_ri_2 (like test_ri);
create unique index test_ri_idx on test_ri(a, b);
\d test_ri
alter table test_ri replica identity using index test_ri_idx;
\d test_ri
alter table test_ri attach partition test_ri_1 for values from (1) to (10);
alter table test_ri attach partition test_ri_2 for values from (11) to (20);
\d test_ri_1
alter table test_ri_1 replica identity using index test_ri_1_a_b_idx;
\d test_ri_1
alter table test_ri_2 replica identity using index test_ri_idx;  -- failed
\d test_ri_2