AW: Possible feature?
От | Zeugswetter Andreas SB |
---|---|
Тема | AW: Possible feature? |
Дата | |
Msg-id | 11C1E6749A55D411A9670001FA68796336837A@sdexcsrv1.f000.d0188.sd.spardat.at обсуждение исходный текст |
Список | pgsql-hackers |
> Then, when the UNIQUE constraint of the index is violated, instead of > the message: > > 'Cannot insert a duplicate key into a unique index i_test1' > > the client application would receive: > > 'An employee with a matching Social Security number already exists' I would only allow this text to be output in addition to the standard text. Else confusion would imho be too great for the unwary admin. Thus following would be returned: ERROR 03005 'Cannot insert a duplicate key into a unique index i_test1' DESCRIPTION 'An employee with a matching Social Security number already exists' On the other hand, what hinders you from using a "speaking" name for the constraint ? postgres=# create table aa (id int, constraint "for Social Security number" unique (id)); NOTICE: CREATE TABLE/UNIQUE will create implicit index 'for Social Security number' for table 'aa' CREATE postgres=# insert into aa values (1); INSERT 23741 1 postgres=# insert into aa values (1); ERROR: Cannot insert a duplicate key into unique index for Social Security number postgres=# :-O Andreas
В списке pgsql-hackers по дате отправления: