mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Improve unique-constraint-violation error messages to include the exact
values being complained of. In passing, also remove the arbitrary length limitation in the similar error detail message for foreign key violations. Itagaki Takahiro
This commit is contained in:
@ -271,10 +271,13 @@ SELECT name, 'A' = name AS t FROM try where name = 'A';
|
||||
-- expected failures on duplicate key
|
||||
INSERT INTO try (name) VALUES ('a');
|
||||
ERROR: duplicate key value violates unique constraint "try_pkey"
|
||||
DETAIL: Key (name)=(a) already exists.
|
||||
INSERT INTO try (name) VALUES ('A');
|
||||
ERROR: duplicate key value violates unique constraint "try_pkey"
|
||||
DETAIL: Key (name)=(A) already exists.
|
||||
INSERT INTO try (name) VALUES ('aB');
|
||||
ERROR: duplicate key value violates unique constraint "try_pkey"
|
||||
DETAIL: Key (name)=(aB) already exists.
|
||||
-- Make sure that citext_smaller() and citext_lager() work properly.
|
||||
SELECT citext_smaller( 'aa'::citext, 'ab'::citext ) = 'aa' AS t;
|
||||
t
|
||||
|
@ -271,10 +271,13 @@ SELECT name, 'A' = name AS t FROM try where name = 'A';
|
||||
-- expected failures on duplicate key
|
||||
INSERT INTO try (name) VALUES ('a');
|
||||
ERROR: duplicate key value violates unique constraint "try_pkey"
|
||||
DETAIL: Key (name)=(a) already exists.
|
||||
INSERT INTO try (name) VALUES ('A');
|
||||
ERROR: duplicate key value violates unique constraint "try_pkey"
|
||||
DETAIL: Key (name)=(A) already exists.
|
||||
INSERT INTO try (name) VALUES ('aB');
|
||||
ERROR: duplicate key value violates unique constraint "try_pkey"
|
||||
DETAIL: Key (name)=(aB) already exists.
|
||||
-- Make sure that citext_smaller() and citext_lager() work properly.
|
||||
SELECT citext_smaller( 'aa'::citext, 'ab'::citext ) = 'aa' AS t;
|
||||
t
|
||||
|
Reference in New Issue
Block a user