Re: BUG #6734: create table (like ...) fails if an index has a comment

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #6734: create table (like ...) fails if an index has a comment
Дата
Msg-id 1330.1342191959@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #6734: create table (like ...) fails if an index has a comment  (Ryan Kelly <rpkelly22@gmail.com>)
Список pgsql-bugs
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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Re: BUG #6734: create table (like ...) fails if an index has a comment
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #6734: create table (like ...) fails if an index has a comment