Proposal: add error message in backend/catalog/index.c

Started by Ioseph Kimabout 9 years ago2 messages
#1Ioseph Kim
pgsql-kr@postgresql.kr

Hi,

I propose to append an error message when index name and table name are
same.

example:

postgres@postgres=# create table t (a int not null, constraint t primary
key (a));
ERROR: relation "t" already exists

End users will confusing pretty, because if users meet this message,
users will check pg_class,

but they will not found in pg_class.

in this case,

"index name must not be same relation name" error message is better.

Some RDBMS are allow that table name and constraint unique, primary key
name are same.

if they meet that message(relation "t" already exists), that message is
not clear.

Regards, Ioseph

#2Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: Ioseph Kim (#1)
Re: Proposal: add error message in backend/catalog/index.c

On 12/13/16 1:15 AM, Ioseph Kim wrote:

I propose to append an error message when index name and table name are
same.

example:

postgres@postgres=# create table t (a int not null, constraint t primary
key (a));
ERROR: relation "t" already exists

The code to detect that would probably be fairly complicated for such a
rare case.

A more principled approach might be to create an error context for the
index creation so that you can tell what is going on when the error happens.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers