Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.

From: Phineas Jensen <phin(at)zayda(dot)net>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: maximilian(dot)chrzan(at)here(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.
Date: 2025-06-18 13:46:38
Message-ID: 13FA2954-21E3-4198-8885-B98EACB08B13@zayda.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On Jun 18, 2025, at 4:29 AM, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> It seems beneficial to embed the parent index name within the names of
> its partitioned child indexes, although it would become tricky when
> building an index for a multi level partition hierarchy but we could
> simplify this by only referencing the top-level user-provided index
> name. This is my perspective, and I'm open to other ideas.

I agree that embedding the parent index name would be the simplest solution for this case, but a similar bug would still happen if no index name was specified for the parent at all (e.g. CREATE INDEX ON parent_table ((jsondata->’a’->’b’)) ), although in that case, the conflict is on the parent table, not the child tables.

Would it be worth making CREATE INDEX add a short hash or some other unique key when no name is specified? Or does it make more sense to just say (maybe in the documentation) that if you are running CREATE INDEX multiple times concurrently that you should specify a name to avoid conflicts?

I created SQL and Bash scripts to reproduce the problem, which I’ve attached.

Phin Jensen



In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-06-18 15:21:51 Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.
Previous Message Dilip Kumar 2025-06-18 10:29:48 Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.