Bug #609: CREATE TABLE with implicit index should not fail if index already exists

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #609: CREATE TABLE with implicit index should not fail if index already exists
Дата
Msg-id 20020307172739.4A12F47612E@postgresql.org
обсуждение исходный текст
Список pgsql-bugs
Vladimir (VAndrianov@Omeda.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
CREATE TABLE with implicit index should not fail if index already exists

Long Description
When PostgreSQL tries to create implicit index during table creation and assumed index's name already exists it fails.
Probably, it's not a bug, but I don't think this behavior is right.
When your intent is to create table with implicit indices you likely don't care about names of those indices. I think
inthis situation PostgreSQL have to construct some unique index name that doesn't conflict with any existent names.
 


Sample Code
demo=# select version();
                            version
---------------------------------------------------------------
 PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.95.4
(1 row)

demo=# create table tst1 (c1 int2 unique);
NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'tst1_c1_key' for table 'tst1'
CREATE
demo=# alter table tst1 rename to tst2;
ALTER
demo=# create table tst1 (c1 int2 unique);
NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'tst1_c1_key' for table 'tst1'
ERROR:  Cannot create index: 'tst1_c1_key' already exists

No file was uploaded with this report

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: regression - postgresql 7.2 on power pc/linux
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #610: collation fails sorting because of strcoll() bug