Re: tablecmds: fix bug where index rebuild loses replica identity on partitions

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Subject: Re: tablecmds: fix bug where index rebuild loses replica identity on partitions
Date: 2026-09-04 22:01:14
Message-ID: CAN4CZFMX+co2f+kxh1rYDBsKoBu1z6H0J--h7Ldgs2F1K6rURw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

My testing found a name collision scenario in v18:

create schema w1; set search_path = w1;
create table p (id int not null, a int not null) partition by list (id);
create table p1 partition of p for values in (1);
create table p2 partition of p for values in (2);
create index p_idx on only p (a); -- invalid parent: nothing attached
create index tmp on p2 (a);
alter index p_idx attach partition tmp; -- p2 attached, p1 still not
alter index tmp rename to p1_a_idx; -- p2's index holds p1's default name
alter table p alter column a type bigint; -- ERROR: relation
"p1_a_idx" already exists; should work

Also, with the additional split 0003 now deletes a test case added by
0001, is that intentional?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Jackson 2026-09-04 22:42:27 Re: Add PAM Tests and Option For Custom PAM Config Location
Previous Message Nathan Bossart 2026-09-04 21:58:11 Re: [PATCH] Fix getopt_long() argument handling and add tests