mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Some small polishing of Mark Hollomon's cleanup of DROP command: might
as well allow DROP multiple INDEX, RULE, TYPE as well. Add missing CommandCounterIncrement to DROP loop, which could cause trouble otherwise with multiple DROP of items affecting same catalog entries. Try to bring a little consistency to various error messages using 'does not exist', 'nonexistent', etc --- I standardized on 'does not exist' since that's what the vast majority of the existing uses seem to be.
This commit is contained in:
@ -52,7 +52,7 @@ drop table;
|
||||
ERROR: parser: parse error at or near ";"
|
||||
-- no such relation
|
||||
drop table nonesuch;
|
||||
ERROR: table "nonesuch" is nonexistent
|
||||
ERROR: table "nonesuch" does not exist
|
||||
--
|
||||
-- RENAME
|
||||
|
||||
@ -81,7 +81,7 @@ alter table nonesuchrel rename column nonesuchatt to newnonesuchatt;
|
||||
ERROR: Relation 'nonesuchrel' does not exist
|
||||
-- no such attribute
|
||||
alter table emp rename column nonesuchatt to newnonesuchatt;
|
||||
ERROR: renameatt: attribute "nonesuchatt" nonexistent
|
||||
ERROR: renameatt: attribute "nonesuchatt" does not exist
|
||||
-- conflict
|
||||
alter table emp rename column salary to manager;
|
||||
ERROR: renameatt: attribute "manager" exists
|
||||
@ -122,7 +122,7 @@ drop index 314159;
|
||||
ERROR: parser: parse error at or near "314159"
|
||||
-- no such index
|
||||
drop index nonesuch;
|
||||
ERROR: index "nonesuch" is nonexistent
|
||||
ERROR: index "nonesuch" does not exist
|
||||
--
|
||||
-- REMOVE AGGREGATE
|
||||
|
||||
|
@ -699,7 +699,7 @@ CREATE TABLE FKTABLE_FAIL2 ( ftest1 int, CONSTRAINT fkfail1 FOREIGN KEY (ftest1)
|
||||
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
|
||||
ERROR: UNIQUE constraint matching given keys for referenced table "pktable" not found
|
||||
DROP TABLE FKTABLE_FAIL1;
|
||||
ERROR: table "fktable_fail1" is nonexistent
|
||||
ERROR: table "fktable_fail1" does not exist
|
||||
DROP TABLE FKTABLE_FAIL2;
|
||||
ERROR: table "fktable_fail2" is nonexistent
|
||||
ERROR: table "fktable_fail2" does not exist
|
||||
DROP TABLE PKTABLE;
|
||||
|
@ -3,7 +3,7 @@
|
||||
--
|
||||
-- prepare the table...
|
||||
DROP TABLE INET_TBL;
|
||||
ERROR: table "inet_tbl" is nonexistent
|
||||
ERROR: table "inet_tbl" does not exist
|
||||
CREATE TABLE INET_TBL (c cidr, i inet);
|
||||
INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.226/24');
|
||||
INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/24', '192.168.1.226');
|
||||
|
@ -587,7 +587,7 @@ begin
|
||||
if mytype = ''PS'' then
|
||||
select into rec * from PSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.backlink != blname then
|
||||
update PSlot set backlink = blname where slotname = myname;
|
||||
@ -597,7 +597,7 @@ begin
|
||||
if mytype = ''WS'' then
|
||||
select into rec * from WSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.backlink != blname then
|
||||
update WSlot set backlink = blname where slotname = myname;
|
||||
@ -607,7 +607,7 @@ begin
|
||||
if mytype = ''PL'' then
|
||||
select into rec * from PLine where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.backlink != blname then
|
||||
update PLine set backlink = blname where slotname = myname;
|
||||
@ -743,7 +743,7 @@ begin
|
||||
if mytype = ''PS'' then
|
||||
select into rec * from PSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update PSlot set slotlink = blname where slotname = myname;
|
||||
@ -753,7 +753,7 @@ begin
|
||||
if mytype = ''WS'' then
|
||||
select into rec * from WSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update WSlot set slotlink = blname where slotname = myname;
|
||||
@ -763,7 +763,7 @@ begin
|
||||
if mytype = ''IF'' then
|
||||
select into rec * from IFace where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update IFace set slotlink = blname where slotname = myname;
|
||||
@ -773,7 +773,7 @@ begin
|
||||
if mytype = ''HS'' then
|
||||
select into rec * from HSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update HSlot set slotlink = blname where slotname = myname;
|
||||
@ -783,7 +783,7 @@ begin
|
||||
if mytype = ''PH'' then
|
||||
select into rec * from PHone where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update PHone set slotlink = blname where slotname = myname;
|
||||
@ -1498,11 +1498,11 @@ select * from PField_v1 where pfname = 'PF0_2' order by slotname;
|
||||
insert into PField values ('PF1_1', 'should fail due to unique index');
|
||||
ERROR: Cannot insert a duplicate key into unique index pfield_name
|
||||
update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
|
||||
ERROR: WS.not.there does not exists
|
||||
ERROR: WS.not.there does not exist
|
||||
update PSlot set backlink = 'XX.illegal' where slotname = 'PS.base.a1';
|
||||
ERROR: illegal backlink beginning with XX
|
||||
update PSlot set slotlink = 'PS.not.there' where slotname = 'PS.base.a1';
|
||||
ERROR: PS.not.there does not exists
|
||||
ERROR: PS.not.there does not exist
|
||||
update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
|
||||
ERROR: illegal slotlink beginning with XX
|
||||
insert into HSlot values ('HS', 'base.hub1', 1, '');
|
||||
|
@ -698,7 +698,7 @@ begin
|
||||
if mytype = ''PS'' then
|
||||
select into rec * from PSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.backlink != blname then
|
||||
update PSlot set backlink = blname where slotname = myname;
|
||||
@ -708,7 +708,7 @@ begin
|
||||
if mytype = ''WS'' then
|
||||
select into rec * from WSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.backlink != blname then
|
||||
update WSlot set backlink = blname where slotname = myname;
|
||||
@ -718,7 +718,7 @@ begin
|
||||
if mytype = ''PL'' then
|
||||
select into rec * from PLine where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.backlink != blname then
|
||||
update PLine set backlink = blname where slotname = myname;
|
||||
@ -866,7 +866,7 @@ begin
|
||||
if mytype = ''PS'' then
|
||||
select into rec * from PSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update PSlot set slotlink = blname where slotname = myname;
|
||||
@ -876,7 +876,7 @@ begin
|
||||
if mytype = ''WS'' then
|
||||
select into rec * from WSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update WSlot set slotlink = blname where slotname = myname;
|
||||
@ -886,7 +886,7 @@ begin
|
||||
if mytype = ''IF'' then
|
||||
select into rec * from IFace where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update IFace set slotlink = blname where slotname = myname;
|
||||
@ -896,7 +896,7 @@ begin
|
||||
if mytype = ''HS'' then
|
||||
select into rec * from HSlot where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update HSlot set slotlink = blname where slotname = myname;
|
||||
@ -906,7 +906,7 @@ begin
|
||||
if mytype = ''PH'' then
|
||||
select into rec * from PHone where slotname = myname;
|
||||
if not found then
|
||||
raise exception ''% does not exists'', myname;
|
||||
raise exception ''% does not exist'', myname;
|
||||
end if;
|
||||
if rec.slotlink != blname then
|
||||
update PHone set slotlink = blname where slotname = myname;
|
||||
|
Reference in New Issue
Block a user