summaryrefslogtreecommitdiff
path: root/contrib/citext
diff options
context:
space:
mode:
authorTom Lane2009-08-01 19:59:41 +0000
committerTom Lane2009-08-01 19:59:41 +0000
commitb680ae4bdbf1c7fd78e6988bbe8f89e1e1b5db86 (patch)
treec8a7f8bc0084a15ff3cdbb5b1b4476c69185ca80 /contrib/citext
parent2487d872e025312e7c16f0dd772190c6787efeea (diff)
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
Diffstat (limited to 'contrib/citext')
-rw-r--r--contrib/citext/expected/citext.out3
-rw-r--r--contrib/citext/expected/citext_1.out3
2 files changed, 6 insertions, 0 deletions
diff --git a/contrib/citext/expected/citext.out b/contrib/citext/expected/citext.out
index 3694cb8b5b3..34ce3da3ee5 100644
--- a/contrib/citext/expected/citext.out
+++ b/contrib/citext/expected/citext.out
@@ -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
diff --git a/contrib/citext/expected/citext_1.out b/contrib/citext/expected/citext_1.out
index 1a6bcdf0bcc..cc03e234ed2 100644
--- a/contrib/citext/expected/citext_1.out
+++ b/contrib/citext/expected/citext_1.out
@@ -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