Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit29dfd5f

Browse files
committed
Change error messages ExecAppend->ExecInsert and ExecReplace->ExecUpdate
as discussed on hackers.
1 parentc20ae1c commit29dfd5f

File tree

6 files changed

+41
-41
lines changed

6 files changed

+41
-41
lines changed

‎src/backend/executor/execMain.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
*
2929
* IDENTIFICATION
30-
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.169 2002/06/26 22:16:54 momjian Exp $
30+
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.170 2002/07/11 21:36:20 momjian Exp $
3131
*
3232
*-------------------------------------------------------------------------
3333
*/
@@ -1223,7 +1223,7 @@ ExecInsert(TupleTableSlot *slot,
12231223
* Check the constraints of the tuple
12241224
*/
12251225
if (resultRelationDesc->rd_att->constr)
1226-
ExecConstraints("ExecAppend",resultRelInfo,slot,estate);
1226+
ExecConstraints("ExecInsert",resultRelInfo,slot,estate);
12271227

12281228
/*
12291229
* insert the tuple
@@ -1369,7 +1369,7 @@ ExecUpdate(TupleTableSlot *slot,
13691369
*/
13701370
if (IsBootstrapProcessingMode())
13711371
{
1372-
elog(WARNING,"ExecReplace: replace can't run without transactions");
1372+
elog(WARNING,"ExecUpdate: UPDATE can't run without transactions");
13731373
return;
13741374
}
13751375

@@ -1420,7 +1420,7 @@ ExecUpdate(TupleTableSlot *slot,
14201420
*/
14211421
lreplace:;
14221422
if (resultRelationDesc->rd_att->constr)
1423-
ExecConstraints("ExecReplace",resultRelInfo,slot,estate);
1423+
ExecConstraints("ExecUpdate",resultRelInfo,slot,estate);
14241424

14251425
/*
14261426
* replace the heap tuple

‎src/test/regress/expected/alter_table.out

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ create table atacc1 ( test int );
411411
alter table atacc1 add constraint atacc_test1 check (test>3);
412412
-- should fail
413413
insert into atacc1 (test) values (2);
414-
ERROR:ExecAppend: rejected due to CHECK constraint atacc_test1
414+
ERROR:ExecInsert: rejected due to CHECK constraint atacc_test1
415415
-- should succeed
416416
insert into atacc1 (test) values (4);
417417
drop table atacc1;
@@ -436,7 +436,7 @@ create table atacc1 ( test int, test2 int, test3 int);
436436
alter table atacc1 add constraint atacc_test1 check (test+test2<test3*4);
437437
-- should fail
438438
insert into atacc1 (test,test2,test3) values (4,4,2);
439-
ERROR:ExecAppend: rejected due to CHECK constraint atacc_test1
439+
ERROR:ExecInsert: rejected due to CHECK constraint atacc_test1
440440
-- should succeed
441441
insert into atacc1 (test,test2,test3) values (4,4,5);
442442
drop table atacc1;
@@ -445,7 +445,7 @@ create table atacc1 (test int check (test>3), test2 int);
445445
alter table atacc1 add check (test2>test);
446446
-- should fail for $2
447447
insert into atacc1 (test2, test) values (3, 4);
448-
ERROR:ExecAppend: rejected due to CHECK constraint $2
448+
ERROR:ExecInsert: rejected due to CHECK constraint $2
449449
drop table atacc1;
450450
-- inheritance related tests
451451
create table atacc1 (test int);
@@ -454,11 +454,11 @@ create table atacc3 (test3 int) inherits (atacc1, atacc2);
454454
alter table atacc2 add constraint foo check (test2>0);
455455
-- fail and then succeed on atacc2
456456
insert into atacc2 (test2) values (-3);
457-
ERROR:ExecAppend: rejected due to CHECK constraint foo
457+
ERROR:ExecInsert: rejected due to CHECK constraint foo
458458
insert into atacc2 (test2) values (3);
459459
-- fail and then succeed on atacc3
460460
insert into atacc3 (test2) values (-3);
461-
ERROR:ExecAppend: rejected due to CHECK constraint foo
461+
ERROR:ExecInsert: rejected due to CHECK constraint foo
462462
insert into atacc3 (test2) values (3);
463463
drop table atacc3;
464464
drop table atacc2;
@@ -470,7 +470,7 @@ create table atacc3 (test3 int) inherits (atacc1, atacc2);
470470
alter table only atacc2 add constraint foo check (test2>0);
471471
-- fail and then succeed on atacc2
472472
insert into atacc2 (test2) values (-3);
473-
ERROR:ExecAppend: rejected due to CHECK constraint foo
473+
ERROR:ExecInsert: rejected due to CHECK constraint foo
474474
insert into atacc2 (test2) values (3);
475475
-- both succeed on atacc3
476476
insert into atacc3 (test2) values (-3);
@@ -608,7 +608,7 @@ insert into atacc1 (test2, test) values (3, 3);
608608
insert into atacc1 (test2, test) values (2, 3);
609609
ERROR: Cannot insert a duplicate key into unique index atacc1_pkey
610610
insert into atacc1 (test2, test) values (1, NULL);
611-
ERROR:ExecAppend: Fail to add null value in not null attribute test
611+
ERROR:ExecInsert: Fail to add null value in not null attribute test
612612
drop table atacc1;
613613
-- alter table / alter column [set/drop] not null tests
614614
-- try altering system catalogs, should fail
@@ -658,9 +658,9 @@ create table parent (a int);
658658
create table child (b varchar(255)) inherits (parent);
659659
alter table parent alter a set not null;
660660
insert into parent values (NULL);
661-
ERROR:ExecAppend: Fail to add null value in not null attribute a
661+
ERROR:ExecInsert: Fail to add null value in not null attribute a
662662
insert into child (a, b) values (NULL, 'foo');
663-
ERROR:ExecAppend: Fail to add null value in not null attribute a
663+
ERROR:ExecInsert: Fail to add null value in not null attribute a
664664
alter table parent alter a drop not null;
665665
insert into parent values (NULL);
666666
insert into child (a, b) values (NULL, 'foo');
@@ -671,14 +671,14 @@ ERROR: ALTER TABLE: Attribute "a" contains NULL values
671671
delete from parent;
672672
alter table only parent alter a set not null;
673673
insert into parent values (NULL);
674-
ERROR:ExecAppend: Fail to add null value in not null attribute a
674+
ERROR:ExecInsert: Fail to add null value in not null attribute a
675675
alter table child alter a set not null;
676676
insert into child (a, b) values (NULL, 'foo');
677-
ERROR:ExecAppend: Fail to add null value in not null attribute a
677+
ERROR:ExecInsert: Fail to add null value in not null attribute a
678678
delete from child;
679679
alter table child alter a set not null;
680680
insert into child (a, b) values (NULL, 'foo');
681-
ERROR:ExecAppend: Fail to add null value in not null attribute a
681+
ERROR:ExecInsert: Fail to add null value in not null attribute a
682682
drop table child;
683683
drop table parent;
684684
-- test setting and removing default values

‎src/test/regress/expected/create_misc.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ INSERT INTO serialTest VALUES ('foo');
142142
INSERT INTO serialTest VALUES ('bar');
143143
INSERT INTO serialTest VALUES ('force', 100);
144144
INSERT INTO serialTest VALUES ('wrong', NULL);
145-
ERROR:ExecAppend: Fail to add null value in not null attribute f2
145+
ERROR:ExecInsert: Fail to add null value in not null attribute f2
146146
SELECT * FROM serialTest;
147147
f1 | f2
148148
-------+-----

‎src/test/regress/expected/domain.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ create table nulltest
9797
, col4 dnull
9898
);
9999
INSERT INTO nulltest DEFAULT VALUES;
100-
ERROR:ExecAppend: Fail to add null value in not null attribute col3
100+
ERROR:ExecInsert: Fail to add null value in not null attribute col3
101101
INSERT INTO nulltest values ('a', 'b', 'c', 'd'); -- Good
102102
INSERT INTO nulltest values (NULL, 'b', 'c', 'd');
103103
ERROR: Domain dnotnull does not allow NULL values
104104
INSERT INTO nulltest values ('a', NULL, 'c', 'd');
105105
ERROR: Domain dnotnull does not allow NULL values
106106
INSERT INTO nulltest values ('a', 'b', NULL, 'd');
107-
ERROR:ExecAppend: Fail to add null value in not null attribute col3
107+
ERROR:ExecInsert: Fail to add null value in not null attribute col3
108108
INSERT INTO nulltest values ('a', 'b', 'c', NULL); -- Good
109109
select * from nulltest;
110110
col1 | col2 | col3 | col4

‎src/test/regress/expected/insert.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--
44
create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
55
insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT);
6-
ERROR:ExecAppend: Fail to add null value in not null attribute col2
6+
ERROR:ExecInsert: Fail to add null value in not null attribute col2
77
insert into inserttest (col2, col3) values (3, DEFAULT);
88
insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT);
99
insert into inserttest values (DEFAULT, 5, 'test');

‎src/test/regress/output/constraints.source

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ CREATE TABLE CHECK_TBL (x int,
6262
INSERT INTO CHECK_TBL VALUES (5);
6363
INSERT INTO CHECK_TBL VALUES (4);
6464
INSERT INTO CHECK_TBL VALUES (3);
65-
ERROR:ExecAppend: rejected due to CHECK constraint check_con
65+
ERROR:ExecInsert: rejected due to CHECK constraint check_con
6666
INSERT INTO CHECK_TBL VALUES (2);
67-
ERROR:ExecAppend: rejected due to CHECK constraint check_con
67+
ERROR:ExecInsert: rejected due to CHECK constraint check_con
6868
INSERT INTO CHECK_TBL VALUES (6);
6969
INSERT INTO CHECK_TBL VALUES (1);
70-
ERROR:ExecAppend: rejected due to CHECK constraint check_con
70+
ERROR:ExecInsert: rejected due to CHECK constraint check_con
7171
SELECT '' AS three, * FROM CHECK_TBL;
7272
three | x
7373
-------+---
@@ -82,13 +82,13 @@ CREATE TABLE CHECK2_TBL (x int, y text, z int,
8282
CHECK (x > 3 and y <> 'check failed' and z < 8));
8383
INSERT INTO CHECK2_TBL VALUES (4, 'check ok', -2);
8484
INSERT INTO CHECK2_TBL VALUES (1, 'x check failed', -2);
85-
ERROR:ExecAppend: rejected due to CHECK constraint sequence_con
85+
ERROR:ExecInsert: rejected due to CHECK constraint sequence_con
8686
INSERT INTO CHECK2_TBL VALUES (5, 'z check failed', 10);
87-
ERROR:ExecAppend: rejected due to CHECK constraint sequence_con
87+
ERROR:ExecInsert: rejected due to CHECK constraint sequence_con
8888
INSERT INTO CHECK2_TBL VALUES (0, 'check failed', -2);
89-
ERROR:ExecAppend: rejected due to CHECK constraint sequence_con
89+
ERROR:ExecInsert: rejected due to CHECK constraint sequence_con
9090
INSERT INTO CHECK2_TBL VALUES (6, 'check failed', 11);
91-
ERROR:ExecAppend: rejected due to CHECK constraint sequence_con
91+
ERROR:ExecInsert: rejected due to CHECK constraint sequence_con
9292
INSERT INTO CHECK2_TBL VALUES (7, 'check ok', 7);
9393
SELECT '' AS two, * from CHECK2_TBL;
9494
two | x | y | z
@@ -107,7 +107,7 @@ CREATE TABLE INSERT_TBL (x INT DEFAULT nextval('insert_seq'),
107107
CONSTRAINT INSERT_CON CHECK (x >= 3 AND y <> 'check failed' AND x < 8),
108108
CHECK (x + z = 0));
109109
INSERT INTO INSERT_TBL(x,z) VALUES (2, -2);
110-
ERROR:ExecAppend: rejected due to CHECK constraint insert_con
110+
ERROR:ExecInsert: rejected due to CHECK constraint insert_con
111111
SELECT '' AS zero, * FROM INSERT_TBL;
112112
zero | x | y | z
113113
------+---+---+---
@@ -120,13 +120,13 @@ SELECT 'one' AS one, nextval('insert_seq');
120120
(1 row)
121121

122122
INSERT INTO INSERT_TBL(y) VALUES ('Y');
123-
ERROR:ExecAppend: rejected due to CHECK constraint insert_con
123+
ERROR:ExecInsert: rejected due to CHECK constraint insert_con
124124
INSERT INTO INSERT_TBL(y) VALUES ('Y');
125125
INSERT INTO INSERT_TBL(x,z) VALUES (1, -2);
126-
ERROR:ExecAppend: rejected due to CHECK constraint $2
126+
ERROR:ExecInsert: rejected due to CHECK constraint $2
127127
INSERT INTO INSERT_TBL(z,x) VALUES (-7, 7);
128128
INSERT INTO INSERT_TBL VALUES (5, 'check failed', -5);
129-
ERROR:ExecAppend: rejected due to CHECK constraint insert_con
129+
ERROR:ExecInsert: rejected due to CHECK constraint insert_con
130130
INSERT INTO INSERT_TBL VALUES (7, '!check failed', -7);
131131
INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-');
132132
SELECT '' AS four, * FROM INSERT_TBL;
@@ -139,9 +139,9 @@ SELECT '' AS four, * FROM INSERT_TBL;
139139
(4 rows)
140140

141141
INSERT INTO INSERT_TBL(y,z) VALUES ('check failed', 4);
142-
ERROR:ExecAppend: rejected due to CHECK constraint $2
142+
ERROR:ExecInsert: rejected due to CHECK constraint $2
143143
INSERT INTO INSERT_TBL(x,y) VALUES (5, 'check failed');
144-
ERROR:ExecAppend: rejected due to CHECK constraint insert_con
144+
ERROR:ExecInsert: rejected due to CHECK constraint insert_con
145145
INSERT INTO INSERT_TBL(x,y) VALUES (5, '!check failed');
146146
INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-');
147147
SELECT '' AS six, * FROM INSERT_TBL;
@@ -162,7 +162,7 @@ SELECT 'seven' AS one, nextval('insert_seq');
162162
(1 row)
163163

164164
INSERT INTO INSERT_TBL(y) VALUES ('Y');
165-
ERROR:ExecAppend: rejected due to CHECK constraint insert_con
165+
ERROR:ExecInsert: rejected due to CHECK constraint insert_con
166166
SELECT 'eight' AS one, currval('insert_seq');
167167
one | currval
168168
-------+---------
@@ -193,11 +193,11 @@ CREATE TABLE INSERT_CHILD (cx INT default 42,
193193
INHERITS (INSERT_TBL);
194194
INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,11);
195195
INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,6);
196-
ERROR:ExecAppend: rejected due to CHECK constraint insert_child_cy
196+
ERROR:ExecInsert: rejected due to CHECK constraint insert_child_cy
197197
INSERT INTO INSERT_CHILD(x,z,cy) VALUES (6,-7,7);
198-
ERROR:ExecAppend: rejected due to CHECK constraint $1
198+
ERROR:ExecInsert: rejected due to CHECK constraint $1
199199
INSERT INTO INSERT_CHILD(x,y,z,cy) VALUES (6,'check failed',-6,7);
200-
ERROR:ExecAppend: rejected due to CHECK constraint insert_con
200+
ERROR:ExecInsert: rejected due to CHECK constraint insert_con
201201
SELECT * FROM INSERT_CHILD;
202202
x | y | z | cx | cy
203203
---+--------+----+----+----
@@ -227,7 +227,7 @@ SELECT '' AS three, * FROM INSERT_TBL;
227227
INSERT INTO INSERT_TBL SELECT * FROM tmp WHERE yd = 'try again';
228228
INSERT INTO INSERT_TBL(y,z) SELECT yd, -7 FROM tmp WHERE yd = 'try again';
229229
INSERT INTO INSERT_TBL(y,z) SELECT yd, -8 FROM tmp WHERE yd = 'try again';
230-
ERROR:ExecAppend: rejected due to CHECK constraint insert_con
230+
ERROR:ExecInsert: rejected due to CHECK constraint insert_con
231231
SELECT '' AS four, * FROM INSERT_TBL;
232232
four | x | y | z
233233
------+---+---------------+----
@@ -246,7 +246,7 @@ UPDATE INSERT_TBL SET x = NULL WHERE x = 5;
246246
UPDATE INSERT_TBL SET x = 6 WHERE x = 6;
247247
UPDATE INSERT_TBL SET x = -z, z = -x;
248248
UPDATE INSERT_TBL SET x = z, z = x;
249-
ERROR:ExecReplace: rejected due to CHECK constraint insert_con
249+
ERROR:ExecUpdate: rejected due to CHECK constraint insert_con
250250
SELECT * FROM INSERT_TBL;
251251
x | y | z
252252
---+---------------+----
@@ -293,7 +293,7 @@ ERROR: Cannot insert a duplicate key into unique index primary_tbl_pkey
293293
INSERT INTO PRIMARY_TBL VALUES (4, 'three');
294294
INSERT INTO PRIMARY_TBL VALUES (5, 'one');
295295
INSERT INTO PRIMARY_TBL (t) VALUES ('six');
296-
ERROR:ExecAppend: Fail to add null value in not null attribute i
296+
ERROR:ExecInsert: Fail to add null value in not null attribute i
297297
SELECT '' AS four, * FROM PRIMARY_TBL;
298298
four | i | t
299299
------+---+-------
@@ -313,7 +313,7 @@ INSERT INTO PRIMARY_TBL VALUES (1, 'three');
313313
INSERT INTO PRIMARY_TBL VALUES (4, 'three');
314314
INSERT INTO PRIMARY_TBL VALUES (5, 'one');
315315
INSERT INTO PRIMARY_TBL (t) VALUES ('six');
316-
ERROR:ExecAppend: Fail to add null value in not null attribute i
316+
ERROR:ExecInsert: Fail to add null value in not null attribute i
317317
SELECT '' AS three, * FROM PRIMARY_TBL;
318318
three | i | t
319319
-------+---+-------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp