Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
2aae35d0
Commit
2aae35d0
authored
Oct 29, 2007
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mention the index name in 'could not create unique index' errors,
per suggestion from Rene Gollent.
parent
b17b7fae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
src/backend/utils/sort/tuplesort.c
src/backend/utils/sort/tuplesort.c
+3
-2
src/test/regress/expected/alter_table.out
src/test/regress/expected/alter_table.out
+2
-2
src/test/regress/expected/create_index.out
src/test/regress/expected/create_index.out
+1
-1
No files found.
src/backend/utils/sort/tuplesort.c
View file @
2aae35d0
...
...
@@ -91,7 +91,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/sort/tuplesort.c,v 1.7
8 2007/09/01 18:47:39
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/sort/tuplesort.c,v 1.7
9 2007/10/29 21:31:28
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2720,7 +2720,8 @@ comparetup_index(const SortTuple *a, const SortTuple *b, Tuplesortstate *state)
if
(
state
->
enforceUnique
&&
!
equal_hasnull
&&
tuple1
!=
tuple2
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_UNIQUE_VIOLATION
),
errmsg
(
"could not create unique index"
),
errmsg
(
"could not create unique index
\"
%s
\"
"
,
RelationGetRelationName
(
state
->
indexRel
)),
errdetail
(
"Table contains duplicated values."
)));
/*
...
...
src/test/regress/expected/alter_table.out
View file @
2aae35d0
...
...
@@ -417,7 +417,7 @@ insert into atacc1 (test) values (2);
-- add a unique constraint (fails)
alter table atacc1 add constraint atacc_test1 unique (test);
NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "atacc_test1" for table "atacc1"
ERROR: could not create unique index
ERROR: could not create unique index
"atacc_test1"
DETAIL: Table contains duplicated values.
insert into atacc1 (test) values (3);
drop table atacc1;
...
...
@@ -485,7 +485,7 @@ insert into atacc1 (test) values (2);
-- add a primary key (fails)
alter table atacc1 add constraint atacc_test1 primary key (test);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "atacc_test1" for table "atacc1"
ERROR: could not create unique index
ERROR: could not create unique index
"atacc_test1"
DETAIL: Table contains duplicated values.
insert into atacc1 (test) values (3);
drop table atacc1;
...
...
src/test/regress/expected/create_index.out
View file @
2aae35d0
...
...
@@ -389,7 +389,7 @@ INSERT INTO concur_heap VALUES ('b','x');
ERROR: duplicate key value violates unique constraint "concur_index2"
-- check if constraint is enforced properly at build time
CREATE UNIQUE INDEX CONCURRENTLY concur_index3 ON concur_heap(f2);
ERROR: could not create unique index
ERROR: could not create unique index
"concur_index3"
DETAIL: Table contains duplicated values.
-- test that expression indexes and partial indexes work concurrently
CREATE INDEX CONCURRENTLY concur_index4 on concur_heap(f2) WHERE f1='a';
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment