Re: BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table.
Phineas Jensen <phin@zayda.net>
From: Phineas Jensen <phin@zayda.net>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: maximilian.chrzan@here.com,
pgsql-bugs@lists.postgresql.org
Date: 2025-06-18T13:46:38Z
Lists: pgsql-bugs, pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Improve the names generated for indexes on expressions.
- 181b6185c79e master landed
-
Use SnapshotDirty when checking for conflicting index names.
- fdd82692230a 17.6 landed
- 75b8982eae78 15.14 landed
- 5861b1f343b5 18.0 landed
- 4b66cb18879e 13.22 landed
- 27af8b9be8c0 14.19 landed
- 1e24ea160350 16.10 landed
-
Change the names generated for child foreign key constraints.
- 3db61db48ef5 18.0 cited
> On Jun 18, 2025, at 4:29 AM, Dilip Kumar <dilipbalaut@gmail.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