From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ryan Kelly <rpkelly22@gmail.com>
Cc: daniele.varrazzo@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6734: create table (like ...) fails if an index has a comment
Date: Fri, 13 Jul 2012 11:05:59 -0400
Message-ID: <1330.1342191959@sss.pgh.pa.us> (raw)
In-Reply-To: <20120713132419.GB2369@llserver.lakeliving.com>
References: <E1SpeXe-0002yi-Rr@wrigleys.postgresql.org>
<20120713132419.GB2369@llserver.lakeliving.com>
Ryan Kelly <rpkelly22@gmail.com> writes:
> The comments on chooseIndexName in src/backend/parser/parse_utilcmd.c say:
> * XXX this is inherently broken because the indexes aren't created
> * immediately, so we fail to resolve conflicts when the same name is
> * derived for multiple indexes.
> Which looks like the case here. So it seems like
> chooseIndexName/ChooseIndexName might need to take a list of any indexes
> names that have already been created to avoid this.
I think a cleaner fix might be for IndexStmt to grow the ability to
specify a comment. What's bogus here is that transformTableLikeClause
has to (try to) lock down the index name in advance of actual creation,
because it wants to generate a plain vanilla CommentStmt. If it didn't
have to do that, everything would be fine, and we could lose
chooseIndexName altogether. ChooseIndexName is fine, because it's only
run at the instant of index creation.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rpkelly22@gmail.com, daniele.varrazzo@gmail.com
Subject: Re: BUG #6734: create table (like ...) fails if an index has a comment
In-Reply-To: <1330.1342191959@sss.pgh.pa.us>
References: <E1SpeXe-0002yi-Rr@wrigleys.postgresql.org> <20120713132419.GB2369@llserver.lakeliving.com> <1330.1342191959@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