pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: michalalbrycht@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16634: Conflicting names of indexes for partitioned tables
Date: Thu, 24 Sep 2020 10:08:54 -0400
Message-ID: <1615413.1600956534@sss.pgh.pa.us> (raw)
In-Reply-To: <16634-7ca61b6fdb17fde8@postgresql.org>
References: <16634-7ca61b6fdb17fde8@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> I think that whole problem is caused by auto-generated name for index for
> partition tables. For parent table postgres is using name provided by user,
> but for children tables it generates names automatically from name of the
> table and fields that are used for index. But when we create index on
> function it uses just function name. So for both indexes it generates name
> like `child_1_lower_idx` despite the fact that one index is using
> `lower(name)` and second one is using `lower(surname)`.
> Why did it work with single thread? Apparently there is mechanism that tries
> to solve conflicts as first index will get name: child_1_lower_idx and
> second one will get child_1_lower_idx1 but for some reason this will not
> work when indexes are created in parallel sessions.

Well, it won't work reliably anyway; that's inherent to the problem.
There's nothing here that's specific to partitioned tables, and I'm
afraid the answer is "don't do that".  It's not very hard to find
other examples where parallel creation of objects can hit conflicts.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <1615413.1600956534@sss.pgh.pa.us>
Permalink:  ../1615413.1600956534@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1615413.1600956534@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michalalbrycht@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16634: Conflicting names of indexes for partitioned tables
  In-Reply-To: <1615413.1600956534@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox