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
f4a3789b
Commit
f4a3789b
authored
Jun 03, 2007
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify some error messages about duplicate things.
parent
55477d74
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
32 additions
and
32 deletions
+32
-32
src/backend/access/common/reloptions.c
src/backend/access/common/reloptions.c
+2
-2
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtinsert.c
+2
-2
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+2
-2
src/backend/commands/tablecmds.c
src/backend/commands/tablecmds.c
+5
-5
src/test/regress/expected/alter_table.out
src/test/regress/expected/alter_table.out
+7
-7
src/test/regress/expected/arrays.out
src/test/regress/expected/arrays.out
+1
-1
src/test/regress/expected/create_index.out
src/test/regress/expected/create_index.out
+3
-3
src/test/regress/expected/inherit.out
src/test/regress/expected/inherit.out
+1
-1
src/test/regress/expected/plpgsql.out
src/test/regress/expected/plpgsql.out
+2
-2
src/test/regress/expected/transactions.out
src/test/regress/expected/transactions.out
+2
-2
src/test/regress/expected/uuid.out
src/test/regress/expected/uuid.out
+1
-1
src/test/regress/output/constraints.source
src/test/regress/output/constraints.source
+3
-3
src/test/regress/output/tablespace.source
src/test/regress/output/tablespace.source
+1
-1
No files found.
src/backend/access/common/reloptions.c
View file @
f4a3789b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/common/reloptions.c,v 1.
4 2007/02/27 23:48:06 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/access/common/reloptions.c,v 1.
5 2007/06/03 22:16:02 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -206,7 +206,7 @@ parseRelOptions(Datum options, int numkeywords, const char *const * keywords,
...
@@ -206,7 +206,7 @@ parseRelOptions(Datum options, int numkeywords, const char *const * keywords,
if
(
values
[
j
]
&&
validate
)
if
(
values
[
j
]
&&
validate
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
errmsg
(
"
duplicate parameter
\"
%s
\"
"
,
errmsg
(
"
parameter
\"
%s
\"
specified more than once
"
,
keywords
[
j
])));
keywords
[
j
])));
value_len
=
text_len
-
kw_len
-
1
;
value_len
=
text_len
-
kw_len
-
1
;
value
=
(
char
*
)
palloc
(
value_len
+
1
);
value
=
(
char
*
)
palloc
(
value_len
+
1
);
...
...
src/backend/access/nbtree/nbtinsert.c
View file @
f4a3789b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.15
7 2007/05/20 21:08:19 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.15
8 2007/06/03 22:16:02 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -287,7 +287,7 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel,
...
@@ -287,7 +287,7 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel,
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_UNIQUE_VIOLATION
),
(
errcode
(
ERRCODE_UNIQUE_VIOLATION
),
errmsg
(
"duplicate key violates unique constraint
\"
%s
\"
"
,
errmsg
(
"duplicate key v
alue v
iolates unique constraint
\"
%s
\"
"
,
RelationGetRelationName
(
rel
))));
RelationGetRelationName
(
rel
))));
}
}
else
if
(
htup
.
t_data
!=
NULL
)
else
if
(
htup
.
t_data
!=
NULL
)
...
...
src/backend/catalog/heap.c
View file @
f4a3789b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.32
1 2007/05/14 20:24:41 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.32
2 2007/06/03 22:16:02 petere
Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -375,7 +375,7 @@ CheckAttributeNamesTypes(TupleDesc tupdesc, char relkind)
...
@@ -375,7 +375,7 @@ CheckAttributeNamesTypes(TupleDesc tupdesc, char relkind)
NameStr
(
tupdesc
->
attrs
[
i
]
->
attname
))
==
0
)
NameStr
(
tupdesc
->
attrs
[
i
]
->
attname
))
==
0
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DUPLICATE_COLUMN
),
(
errcode
(
ERRCODE_DUPLICATE_COLUMN
),
errmsg
(
"column name
\"
%s
\"
is duplicated
"
,
errmsg
(
"column name
\"
%s
\"
specified more than once
"
,
NameStr
(
tupdesc
->
attrs
[
j
]
->
attname
))));
NameStr
(
tupdesc
->
attrs
[
j
]
->
attname
))));
}
}
}
}
...
...
src/backend/commands/tablecmds.c
View file @
f4a3789b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.22
6 2007/06/03 17:06:25 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.22
7 2007/06/03 22:16:03 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -791,7 +791,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
...
@@ -791,7 +791,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
if
(
strcmp
(
coldef
->
colname
,
restdef
->
colname
)
==
0
)
if
(
strcmp
(
coldef
->
colname
,
restdef
->
colname
)
==
0
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DUPLICATE_COLUMN
),
(
errcode
(
ERRCODE_DUPLICATE_COLUMN
),
errmsg
(
"column
\"
%s
\"
duplicated
"
,
errmsg
(
"column
\"
%s
\"
specified more than once
"
,
coldef
->
colname
)));
coldef
->
colname
)));
}
}
}
}
...
@@ -839,7 +839,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
...
@@ -839,7 +839,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
if
(
list_member_oid
(
parentOids
,
RelationGetRelid
(
relation
)))
if
(
list_member_oid
(
parentOids
,
RelationGetRelid
(
relation
)))
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DUPLICATE_TABLE
),
(
errcode
(
ERRCODE_DUPLICATE_TABLE
),
errmsg
(
"
inherited relation
\"
%s
\"
duplicated
"
,
errmsg
(
"
relation
\"
%s
\"
would be inherited from more than once
"
,
parent
->
relname
)));
parent
->
relname
)));
parentOids
=
lappend_oid
(
parentOids
,
RelationGetRelid
(
relation
));
parentOids
=
lappend_oid
(
parentOids
,
RelationGetRelid
(
relation
));
...
@@ -1139,7 +1139,7 @@ add_nonduplicate_constraint(Constraint *cdef, ConstrCheck *check, int *ncheck)
...
@@ -1139,7 +1139,7 @@ add_nonduplicate_constraint(Constraint *cdef, ConstrCheck *check, int *ncheck)
return
;
/* duplicate constraint, so ignore it */
return
;
/* duplicate constraint, so ignore it */
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DUPLICATE_OBJECT
),
(
errcode
(
ERRCODE_DUPLICATE_OBJECT
),
errmsg
(
"
duplicate check constraint name
\"
%s
\"
"
,
errmsg
(
"
check constraint name
\"
%s
\"
appears multiple times but with different expressions
"
,
cdef
->
name
)));
cdef
->
name
)));
}
}
/* No match on name, so add it to array */
/* No match on name, so add it to array */
...
@@ -6013,7 +6013,7 @@ ATExecAddInherit(Relation child_rel, RangeVar *parent)
...
@@ -6013,7 +6013,7 @@ ATExecAddInherit(Relation child_rel, RangeVar *parent)
if
(
inh
->
inhparent
==
RelationGetRelid
(
parent_rel
))
if
(
inh
->
inhparent
==
RelationGetRelid
(
parent_rel
))
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DUPLICATE_TABLE
),
(
errcode
(
ERRCODE_DUPLICATE_TABLE
),
errmsg
(
"
inherited relation
\"
%s
\"
duplicated
"
,
errmsg
(
"
relation
\"
%s
\"
would be inherited from more than once
"
,
RelationGetRelationName
(
parent_rel
))));
RelationGetRelationName
(
parent_rel
))));
if
(
inh
->
inhseqno
>
inhseqno
)
if
(
inh
->
inhseqno
>
inhseqno
)
inhseqno
=
inh
->
inhseqno
;
inhseqno
=
inh
->
inhseqno
;
...
...
src/test/regress/expected/alter_table.out
View file @
f4a3789b
...
@@ -360,7 +360,7 @@ alter table atacc3 add constraint foo check (test2>0);
...
@@ -360,7 +360,7 @@ alter table atacc3 add constraint foo check (test2>0);
alter table atacc3 inherit atacc2;
alter table atacc3 inherit atacc2;
-- fail due to duplicates and circular inheritance
-- fail due to duplicates and circular inheritance
alter table atacc3 inherit atacc2;
alter table atacc3 inherit atacc2;
ERROR:
inherited relation "atacc2" duplicated
ERROR:
relation "atacc2" would be inherited from more than once
alter table atacc2 inherit atacc3;
alter table atacc2 inherit atacc3;
ERROR: circular inheritance not allowed
ERROR: circular inheritance not allowed
DETAIL: "atacc3" is already a child of "atacc2".
DETAIL: "atacc3" is already a child of "atacc2".
...
@@ -402,7 +402,7 @@ NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "atacc_test1" for t
...
@@ -402,7 +402,7 @@ NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "atacc_test1" for t
insert into atacc1 (test) values (2);
insert into atacc1 (test) values (2);
-- should fail
-- should fail
insert into atacc1 (test) values (2);
insert into atacc1 (test) values (2);
ERROR: duplicate key violates unique constraint "atacc_test1"
ERROR: duplicate key v
alue v
iolates unique constraint "atacc_test1"
-- should succeed
-- should succeed
insert into atacc1 (test) values (4);
insert into atacc1 (test) values (4);
-- try adding a unique oid constraint
-- try adding a unique oid constraint
...
@@ -437,7 +437,7 @@ NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "atacc_test1" for t
...
@@ -437,7 +437,7 @@ NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "atacc_test1" for t
insert into atacc1 (test,test2) values (4,4);
insert into atacc1 (test,test2) values (4,4);
-- should fail
-- should fail
insert into atacc1 (test,test2) values (4,4);
insert into atacc1 (test,test2) values (4,4);
ERROR: duplicate key violates unique constraint "atacc_test1"
ERROR: duplicate key v
alue v
iolates unique constraint "atacc_test1"
-- should all succeed
-- should all succeed
insert into atacc1 (test,test2) values (4,5);
insert into atacc1 (test,test2) values (4,5);
insert into atacc1 (test,test2) values (5,4);
insert into atacc1 (test,test2) values (5,4);
...
@@ -451,7 +451,7 @@ NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "atacc1_test2_key"
...
@@ -451,7 +451,7 @@ NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "atacc1_test2_key"
-- should fail for @@ second one @@
-- should fail for @@ second one @@
insert into atacc1 (test2, test) values (3, 3);
insert into atacc1 (test2, test) values (3, 3);
insert into atacc1 (test2, test) values (2, 3);
insert into atacc1 (test2, test) values (2, 3);
ERROR: duplicate key violates unique constraint "atacc1_test_key"
ERROR: duplicate key v
alue v
iolates unique constraint "atacc1_test_key"
drop table atacc1;
drop table atacc1;
-- test primary key constraint adding
-- test primary key constraint adding
create table atacc1 ( test int ) with oids;
create table atacc1 ( test int ) with oids;
...
@@ -462,7 +462,7 @@ NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "atacc_test1"
...
@@ -462,7 +462,7 @@ NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "atacc_test1"
insert into atacc1 (test) values (2);
insert into atacc1 (test) values (2);
-- should fail
-- should fail
insert into atacc1 (test) values (2);
insert into atacc1 (test) values (2);
ERROR: duplicate key violates unique constraint "atacc_test1"
ERROR: duplicate key v
alue v
iolates unique constraint "atacc_test1"
-- should succeed
-- should succeed
insert into atacc1 (test) values (4);
insert into atacc1 (test) values (4);
-- inserting NULL should fail
-- inserting NULL should fail
...
@@ -517,7 +517,7 @@ ERROR: multiple primary keys for table "atacc1" are not allowed
...
@@ -517,7 +517,7 @@ ERROR: multiple primary keys for table "atacc1" are not allowed
insert into atacc1 (test,test2) values (4,4);
insert into atacc1 (test,test2) values (4,4);
-- should fail
-- should fail
insert into atacc1 (test,test2) values (4,4);
insert into atacc1 (test,test2) values (4,4);
ERROR: duplicate key violates unique constraint "atacc_test1"
ERROR: duplicate key v
alue v
iolates unique constraint "atacc_test1"
insert into atacc1 (test,test2) values (NULL,3);
insert into atacc1 (test,test2) values (NULL,3);
ERROR: null value in column "test" violates not-null constraint
ERROR: null value in column "test" violates not-null constraint
insert into atacc1 (test,test2) values (3, NULL);
insert into atacc1 (test,test2) values (3, NULL);
...
@@ -535,7 +535,7 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "atacc1_pkey" for
...
@@ -535,7 +535,7 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "atacc1_pkey" for
-- only first should succeed
-- only first should succeed
insert into atacc1 (test2, test) values (3, 3);
insert into atacc1 (test2, test) values (3, 3);
insert into atacc1 (test2, test) values (2, 3);
insert into atacc1 (test2, test) values (2, 3);
ERROR: duplicate key violates unique constraint "atacc1_pkey"
ERROR: duplicate key v
alue v
iolates unique constraint "atacc1_pkey"
insert into atacc1 (test2, test) values (1, NULL);
insert into atacc1 (test2, test) values (1, NULL);
ERROR: null value in column "test" violates not-null constraint
ERROR: null value in column "test" violates not-null constraint
drop table atacc1;
drop table atacc1;
...
...
src/test/regress/expected/arrays.out
View file @
f4a3789b
...
@@ -703,7 +703,7 @@ insert into arr_tbl values ('{1,2,3}');
...
@@ -703,7 +703,7 @@ insert into arr_tbl values ('{1,2,3}');
insert into arr_tbl values ('{1,2}');
insert into arr_tbl values ('{1,2}');
-- failure expected:
-- failure expected:
insert into arr_tbl values ('{1,2,3}');
insert into arr_tbl values ('{1,2,3}');
ERROR: duplicate key violates unique constraint "arr_tbl_f1_key"
ERROR: duplicate key v
alue v
iolates unique constraint "arr_tbl_f1_key"
insert into arr_tbl values ('{2,3,4}');
insert into arr_tbl values ('{2,3,4}');
insert into arr_tbl values ('{1,5,3}');
insert into arr_tbl values ('{1,5,3}');
insert into arr_tbl values ('{1,2,10}');
insert into arr_tbl values ('{1,2,10}');
...
...
src/test/regress/expected/create_index.out
View file @
f4a3789b
...
@@ -348,7 +348,7 @@ INSERT INTO func_index_heap VALUES('AB','CDEFG');
...
@@ -348,7 +348,7 @@ INSERT INTO func_index_heap VALUES('AB','CDEFG');
INSERT INTO func_index_heap VALUES('QWE','RTY');
INSERT INTO func_index_heap VALUES('QWE','RTY');
-- this should fail because of unique index:
-- this should fail because of unique index:
INSERT INTO func_index_heap VALUES('ABCD', 'EF');
INSERT INTO func_index_heap VALUES('ABCD', 'EF');
ERROR: duplicate key violates unique constraint "func_index_index"
ERROR: duplicate key v
alue v
iolates unique constraint "func_index_index"
-- but this shouldn't:
-- but this shouldn't:
INSERT INTO func_index_heap VALUES('QWERTY');
INSERT INTO func_index_heap VALUES('QWERTY');
--
--
...
@@ -362,7 +362,7 @@ INSERT INTO func_index_heap VALUES('AB','CDEFG');
...
@@ -362,7 +362,7 @@ INSERT INTO func_index_heap VALUES('AB','CDEFG');
INSERT INTO func_index_heap VALUES('QWE','RTY');
INSERT INTO func_index_heap VALUES('QWE','RTY');
-- this should fail because of unique index:
-- this should fail because of unique index:
INSERT INTO func_index_heap VALUES('ABCD', 'EF');
INSERT INTO func_index_heap VALUES('ABCD', 'EF');
ERROR: duplicate key violates unique constraint "func_index_index"
ERROR: duplicate key v
alue v
iolates unique constraint "func_index_index"
-- but this shouldn't:
-- but this shouldn't:
INSERT INTO func_index_heap VALUES('QWERTY');
INSERT INTO func_index_heap VALUES('QWERTY');
--
--
...
@@ -386,7 +386,7 @@ INSERT INTO concur_heap VALUES ('b','b');
...
@@ -386,7 +386,7 @@ INSERT INTO concur_heap VALUES ('b','b');
CREATE UNIQUE INDEX CONCURRENTLY concur_index2 ON concur_heap(f1);
CREATE UNIQUE INDEX CONCURRENTLY concur_index2 ON concur_heap(f1);
-- check if constraint is set up properly to be enforced
-- check if constraint is set up properly to be enforced
INSERT INTO concur_heap VALUES ('b','x');
INSERT INTO concur_heap VALUES ('b','x');
ERROR: duplicate key violates unique constraint "concur_index2"
ERROR: duplicate key v
alue v
iolates unique constraint "concur_index2"
-- check if constraint is enforced properly at build time
-- check if constraint is enforced properly at build time
CREATE UNIQUE INDEX CONCURRENTLY concur_index3 ON concur_heap(f2);
CREATE UNIQUE INDEX CONCURRENTLY concur_index3 ON concur_heap(f2);
ERROR: could not create unique index
ERROR: could not create unique index
...
...
src/test/regress/expected/inherit.out
View file @
f4a3789b
...
@@ -605,7 +605,7 @@ SELECT * FROM a; /* Has ee entry */
...
@@ -605,7 +605,7 @@ SELECT * FROM a; /* Has ee entry */
(1 row)
(1 row)
CREATE TABLE inhf (LIKE inhx, LIKE inhx); /* Throw error */
CREATE TABLE inhf (LIKE inhx, LIKE inhx); /* Throw error */
ERROR: column "xx"
duplicated
ERROR: column "xx"
specified more than once
CREATE TABLE inhf (LIKE inhx INCLUDING DEFAULTS INCLUDING CONSTRAINTS);
CREATE TABLE inhf (LIKE inhx INCLUDING DEFAULTS INCLUDING CONSTRAINTS);
INSERT INTO inhf DEFAULT VALUES;
INSERT INTO inhf DEFAULT VALUES;
SELECT * FROM inhf; /* Single entry with value 'text' */
SELECT * FROM inhf; /* Single entry with value 'text' */
...
...
src/test/regress/expected/plpgsql.out
View file @
f4a3789b
...
@@ -1516,7 +1516,7 @@ select * from PField_v1 where pfname = 'PF0_2' order by slotname;
...
@@ -1516,7 +1516,7 @@ select * from PField_v1 where pfname = 'PF0_2' order by slotname;
-- Finally we want errors
-- Finally we want errors
--
--
insert into PField values ('PF1_1', 'should fail due to unique index');
insert into PField values ('PF1_1', 'should fail due to unique index');
ERROR: duplicate key violates unique constraint "pfield_name"
ERROR: duplicate key v
alue v
iolates unique constraint "pfield_name"
update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
ERROR: WS.not.there does not exist
ERROR: WS.not.there does not exist
CONTEXT: PL/pgSQL function "tg_backlink_a" line 16 at assignment
CONTEXT: PL/pgSQL function "tg_backlink_a" line 16 at assignment
...
@@ -1530,7 +1530,7 @@ update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
...
@@ -1530,7 +1530,7 @@ update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal slotlink beginning with XX
ERROR: illegal slotlink beginning with XX
CONTEXT: PL/pgSQL function "tg_slotlink_a" line 16 at assignment
CONTEXT: PL/pgSQL function "tg_slotlink_a" line 16 at assignment
insert into HSlot values ('HS', 'base.hub1', 1, '');
insert into HSlot values ('HS', 'base.hub1', 1, '');
ERROR: duplicate key violates unique constraint "hslot_name"
ERROR: duplicate key v
alue v
iolates unique constraint "hslot_name"
insert into HSlot values ('HS', 'base.hub1', 20, '');
insert into HSlot values ('HS', 'base.hub1', 20, '');
ERROR: no manual manipulation of HSlot
ERROR: no manual manipulation of HSlot
delete from HSlot;
delete from HSlot;
...
...
src/test/regress/expected/transactions.out
View file @
f4a3789b
...
@@ -463,13 +463,13 @@ BEGIN;
...
@@ -463,13 +463,13 @@ BEGIN;
NOTICE: CREATE TABLE / UNIQUE will create implicit index "koju_a_key" for table "koju"
NOTICE: CREATE TABLE / UNIQUE will create implicit index "koju_a_key" for table "koju"
INSERT INTO koju VALUES (1);
INSERT INTO koju VALUES (1);
INSERT INTO koju VALUES (1);
INSERT INTO koju VALUES (1);
ERROR: duplicate key violates unique constraint "koju_a_key"
ERROR: duplicate key v
alue v
iolates unique constraint "koju_a_key"
rollback to x;
rollback to x;
CREATE TABLE koju (a INT UNIQUE);
CREATE TABLE koju (a INT UNIQUE);
NOTICE: CREATE TABLE / UNIQUE will create implicit index "koju_a_key" for table "koju"
NOTICE: CREATE TABLE / UNIQUE will create implicit index "koju_a_key" for table "koju"
INSERT INTO koju VALUES (1);
INSERT INTO koju VALUES (1);
INSERT INTO koju VALUES (1);
INSERT INTO koju VALUES (1);
ERROR: duplicate key violates unique constraint "koju_a_key"
ERROR: duplicate key v
alue v
iolates unique constraint "koju_a_key"
ROLLBACK;
ROLLBACK;
DROP TABLE foo;
DROP TABLE foo;
DROP TABLE baz;
DROP TABLE baz;
...
...
src/test/regress/expected/uuid.out
View file @
f4a3789b
...
@@ -106,7 +106,7 @@ CREATE INDEX guid1_hash ON guid1 USING HASH (guid_field);
...
@@ -106,7 +106,7 @@ CREATE INDEX guid1_hash ON guid1 USING HASH (guid_field);
CREATE UNIQUE INDEX guid1_unique_BTREE ON guid1 USING BTREE (guid_field);
CREATE UNIQUE INDEX guid1_unique_BTREE ON guid1 USING BTREE (guid_field);
-- should fail
-- should fail
INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111');
ERROR: duplicate key violates unique constraint "guid1_unique_btree"
ERROR: duplicate key v
alue v
iolates unique constraint "guid1_unique_btree"
-- check to see whether the new indexes are actually there
-- check to see whether the new indexes are actually there
SELECT count(*) FROM pg_class WHERE relkind='i' AND relname LIKE 'guid%';
SELECT count(*) FROM pg_class WHERE relkind='i' AND relname LIKE 'guid%';
count
count
...
...
src/test/regress/output/constraints.source
View file @
f4a3789b
...
@@ -293,7 +293,7 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "primary_tbl_pkey
...
@@ -293,7 +293,7 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "primary_tbl_pkey
INSERT INTO PRIMARY_TBL VALUES (1, 'one');
INSERT INTO PRIMARY_TBL VALUES (1, 'one');
INSERT INTO PRIMARY_TBL VALUES (2, 'two');
INSERT INTO PRIMARY_TBL VALUES (2, 'two');
INSERT INTO PRIMARY_TBL VALUES (1, 'three');
INSERT INTO PRIMARY_TBL VALUES (1, 'three');
ERROR: duplicate key violates unique constraint "primary_tbl_pkey"
ERROR: duplicate key v
alue v
iolates unique constraint "primary_tbl_pkey"
INSERT INTO PRIMARY_TBL VALUES (4, 'three');
INSERT INTO PRIMARY_TBL VALUES (4, 'three');
INSERT INTO PRIMARY_TBL VALUES (5, 'one');
INSERT INTO PRIMARY_TBL VALUES (5, 'one');
INSERT INTO PRIMARY_TBL (t) VALUES ('six');
INSERT INTO PRIMARY_TBL (t) VALUES ('six');
...
@@ -337,7 +337,7 @@ NOTICE: CREATE TABLE / UNIQUE will create implicit index "unique_tbl_i_key" for
...
@@ -337,7 +337,7 @@ NOTICE: CREATE TABLE / UNIQUE will create implicit index "unique_tbl_i_key" for
INSERT INTO UNIQUE_TBL VALUES (1, 'one');
INSERT INTO UNIQUE_TBL VALUES (1, 'one');
INSERT INTO UNIQUE_TBL VALUES (2, 'two');
INSERT INTO UNIQUE_TBL VALUES (2, 'two');
INSERT INTO UNIQUE_TBL VALUES (1, 'three');
INSERT INTO UNIQUE_TBL VALUES (1, 'three');
ERROR: duplicate key violates unique constraint "unique_tbl_i_key"
ERROR: duplicate key v
alue v
iolates unique constraint "unique_tbl_i_key"
INSERT INTO UNIQUE_TBL VALUES (4, 'four');
INSERT INTO UNIQUE_TBL VALUES (4, 'four');
INSERT INTO UNIQUE_TBL VALUES (5, 'one');
INSERT INTO UNIQUE_TBL VALUES (5, 'one');
INSERT INTO UNIQUE_TBL (t) VALUES ('six');
INSERT INTO UNIQUE_TBL (t) VALUES ('six');
...
@@ -361,7 +361,7 @@ INSERT INTO UNIQUE_TBL VALUES (1, 'one');
...
@@ -361,7 +361,7 @@ INSERT INTO UNIQUE_TBL VALUES (1, 'one');
INSERT INTO UNIQUE_TBL VALUES (2, 'two');
INSERT INTO UNIQUE_TBL VALUES (2, 'two');
INSERT INTO UNIQUE_TBL VALUES (1, 'three');
INSERT INTO UNIQUE_TBL VALUES (1, 'three');
INSERT INTO UNIQUE_TBL VALUES (1, 'one');
INSERT INTO UNIQUE_TBL VALUES (1, 'one');
ERROR: duplicate key violates unique constraint "unique_tbl_i_key"
ERROR: duplicate key v
alue v
iolates unique constraint "unique_tbl_i_key"
INSERT INTO UNIQUE_TBL VALUES (5, 'one');
INSERT INTO UNIQUE_TBL VALUES (5, 'one');
INSERT INTO UNIQUE_TBL (t) VALUES ('six');
INSERT INTO UNIQUE_TBL (t) VALUES ('six');
SELECT '' AS five, * FROM UNIQUE_TBL;
SELECT '' AS five, * FROM UNIQUE_TBL;
...
...
src/test/regress/output/tablespace.source
View file @
f4a3789b
...
@@ -48,7 +48,7 @@ ALTER TABLE testschema.atable SET TABLESPACE testspace;
...
@@ -48,7 +48,7 @@ ALTER TABLE testschema.atable SET TABLESPACE testspace;
ALTER INDEX testschema.anindex SET TABLESPACE testspace;
ALTER INDEX testschema.anindex SET TABLESPACE testspace;
INSERT INTO testschema.atable VALUES(3); -- ok
INSERT INTO testschema.atable VALUES(3); -- ok
INSERT INTO testschema.atable VALUES(1); -- fail (checks index)
INSERT INTO testschema.atable VALUES(1); -- fail (checks index)
ERROR: duplicate key violates unique constraint "anindex"
ERROR: duplicate key v
alue v
iolates unique constraint "anindex"
SELECT COUNT(*) FROM testschema.atable; -- checks heap
SELECT COUNT(*) FROM testschema.atable; -- checks heap
count
count
-------
-------
...
...
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