notice on explicit primary key or index name

Started by Tomas Psikaover 16 years ago2 messagesbugs
Jump to latest
#1Tomas Psika
tomas.psika@gmail.com

Hi,

when primary key or unique index is created using explicit name, strange
notice will say that implicit name was generated. But it didnt.

# select version();
PostgreSQL 8.4.1 on i686-pc-linux-gnu, compiled by GCC
i686-pc-linux-gnu-gcc (Gentoo 4.3.4 p1.0, pie-10.1.5) 4.3.4, 32-bit

# create table dummy(x integer, y integer);
CREATE TABLE

# alter table dummy add constraint pk_dummy_x primary key (x);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index
"pk_dummy_x" for table "dummy"
ALTER TABLE

Maybe problem in src/backend/commands/indexcmds.c. Untested patch attached.

Regards, Tomas Psika

Attachments:

implicit_name.patchtext/plain; name=implicit_name.patchDownload+5-2
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tomas Psika (#1)
Re: notice on explicit primary key or index name

Tomas Psika <tomas.psika@gmail.com> writes:

when primary key or unique index is created using explicit name, strange
notice will say that implicit name was generated. But it didnt.

# alter table dummy add constraint pk_dummy_x primary key (x);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index
"pk_dummy_x" for table "dummy"

The index is what's implicit, not the name.

regards, tom lane