mirror of https://github.com/postgres/postgres
but it gets rid of the temptation to modify the old source files :)pull/50/head
parent
4999f002e6
commit
b5183bf64b
@ -1,285 +0,0 @@ |
||||
-- |
||||
-- destroy.source |
||||
-- |
||||
-- $Header: /cvsroot/pgsql/src/test/regress/Attic/destroy.source,v 1.1.1.1 1996/07/09 06:22:24 scrappy Exp $ |
||||
-- |
||||
|
||||
-- |
||||
-- this will fail if the user is not the postgres superuser. |
||||
-- if it does, don't worry about it (you can turn usersuper |
||||
-- back on as "postgres"). too many people don't follow |
||||
-- directions and run this as "postgres", though... |
||||
-- |
||||
UPDATE pg_user |
||||
SET usesuper = 't'::bool |
||||
WHERE usename = '_USER_'; |
||||
|
||||
|
||||
-- |
||||
-- FUNCTION REMOVAL |
||||
-- |
||||
DROP FUNCTION hobbies(person); |
||||
|
||||
DROP FUNCTION hobby_construct(text,text); |
||||
|
||||
DROP FUNCTION equipment(hobbies_r); |
||||
|
||||
DROP FUNCTION user_relns(); |
||||
|
||||
DROP FUNCTION circle_in(opaque); |
||||
|
||||
DROP FUNCTION circle_out(opaque); |
||||
|
||||
DROP FUNCTION pt_in_circle(point,circle); |
||||
|
||||
DROP FUNCTION overpaid(emp); |
||||
|
||||
DROP FUNCTION boxarea(box); |
||||
|
||||
DROP FUNCTION interpt_pp(path,path); |
||||
|
||||
DROP FUNCTION reverse_c16(char16); |
||||
|
||||
|
||||
-- |
||||
-- OPERATOR REMOVAL |
||||
-- |
||||
DROP OPERATOR ## (path, path); |
||||
|
||||
DROP OPERATOR <% (point, circle); |
||||
|
||||
-- left unary |
||||
DROP OPERATOR @#@ (none, int4); |
||||
|
||||
-- right unary |
||||
DROP OPERATOR #@# (int4, none); |
||||
|
||||
-- right unary |
||||
DROP OPERATOR #%# (int4, none); |
||||
|
||||
|
||||
-- |
||||
-- ABSTRACT DATA TYPE REMOVAL |
||||
-- |
||||
DROP TYPE city_budget; |
||||
|
||||
DROP TYPE circle; |
||||
|
||||
|
||||
-- |
||||
-- RULE REMOVAL |
||||
-- (is also tested in queries.source) |
||||
-- |
||||
|
||||
-- |
||||
-- AGGREGATE REMOVAL |
||||
-- |
||||
DROP AGGREGATE newavg; |
||||
|
||||
DROP AGGREGATE newsum; |
||||
|
||||
DROP AGGREGATE newcnt; |
||||
|
||||
|
||||
-- |
||||
-- CLASS REMOVAL |
||||
-- (inheritance hierarchies are deleted in reverse order) |
||||
-- |
||||
|
||||
-- |
||||
-- DROP ancillary data structures (i.e. indices) |
||||
-- |
||||
DROP INDEX onek_unique1; |
||||
|
||||
DROP INDEX onek_unique2; |
||||
|
||||
DROP INDEX onek_hundred; |
||||
|
||||
DROP INDEX onek_stringu1; |
||||
|
||||
DROP INDEX tenk1_unique1; |
||||
|
||||
DROP INDEX tenk1_unique2; |
||||
|
||||
DROP INDEX tenk1_hundred; |
||||
|
||||
DROP INDEX tenk2_unique1; |
||||
|
||||
DROP INDEX tenk2_unique2; |
||||
|
||||
DROP INDEX tenk2_hundred; |
||||
|
||||
-- DROP INDEX onek2_u1_prtl; |
||||
|
||||
-- DROP INDEX onek2_u2_prtl; |
||||
|
||||
-- DROP INDEX onek2_stu1_prtl; |
||||
|
||||
DROP INDEX rect2ind; |
||||
|
||||
DROP INDEX rix; |
||||
|
||||
DROP INDEX iix; |
||||
|
||||
DROP INDEX six; |
||||
|
||||
DROP INDEX hash_i4_index; |
||||
|
||||
DROP INDEX hash_c16_index; |
||||
|
||||
DROP INDEX hash_txt_index; |
||||
|
||||
DROP INDEX hash_f8_index; |
||||
|
||||
-- DROP INDEX hash_ovfl_index; |
||||
|
||||
DROP INDEX bt_i4_index; |
||||
|
||||
DROP INDEX bt_c16_index; |
||||
|
||||
DROP INDEX bt_txt_index; |
||||
|
||||
DROP INDEX bt_f8_index; |
||||
|
||||
|
||||
DROP TABLE onek; |
||||
|
||||
DROP TABLE onek2; |
||||
|
||||
DROP TABLE tenk1; |
||||
|
||||
DROP TABLE tenk2; |
||||
|
||||
DROP TABLE Bprime; |
||||
|
||||
|
||||
DROP TABLE hobbies_r; |
||||
|
||||
DROP TABLE equipment_r; |
||||
|
||||
|
||||
DROP TABLE aggtest; |
||||
|
||||
DROP TABLE xacttest; |
||||
|
||||
DROP TABLE arrtest; |
||||
|
||||
DROP TABLE iportaltest; |
||||
|
||||
|
||||
DROP TABLE f_star; |
||||
|
||||
DROP TABLE e_star; |
||||
|
||||
DROP TABLE d_star; |
||||
|
||||
DROP TABLE c_star; |
||||
|
||||
DROP TABLE b_star; |
||||
|
||||
DROP TABLE a_star; |
||||
|
||||
|
||||
-- |
||||
-- must be in reverse inheritance order |
||||
-- |
||||
DROP TABLE stud_emp; |
||||
|
||||
DROP TABLE student; |
||||
|
||||
DROP TABLE slow_emp4000; |
||||
|
||||
DROP TABLE fast_emp4000; |
||||
|
||||
DROP TABLE emp; |
||||
|
||||
DROP TABLE person; |
||||
|
||||
|
||||
DROP TABLE ramp; |
||||
|
||||
DROP TABLE real_city; |
||||
|
||||
DROP TABLE dept; |
||||
|
||||
DROP TABLE ihighway; |
||||
|
||||
DROP TABLE shighway; |
||||
|
||||
DROP TABLE road; |
||||
|
||||
DROP TABLE city; |
||||
|
||||
|
||||
DROP TABLE hash_i4_heap; |
||||
|
||||
DROP TABLE hash_c16_heap; |
||||
|
||||
DROP TABLE hash_txt_heap; |
||||
|
||||
DROP TABLE hash_f8_heap; |
||||
|
||||
-- DROP TABLE hash_ovfl_heap; |
||||
|
||||
DROP TABLE bt_i4_heap; |
||||
|
||||
DROP TABLE bt_c16_heap; |
||||
|
||||
DROP TABLE bt_txt_heap; |
||||
|
||||
DROP TABLE bt_f8_heap; |
||||
|
||||
|
||||
DROP TABLE BOOLTBL1; |
||||
|
||||
DROP TABLE BOOLTBL2; |
||||
|
||||
DROP TABLE ABSTIME_TBL; |
||||
|
||||
DROP TABLE RELTIME_TBL; |
||||
|
||||
DROP TABLE TINTERVAL_TBL; |
||||
|
||||
DROP TABLE BOX_TBL; |
||||
|
||||
DROP TABLE CHAR_TBL; |
||||
|
||||
DROP TABLE CHAR2_TBL; |
||||
|
||||
DROP TABLE CHAR4_TBL; |
||||
|
||||
DROP TABLE CHAR8_TBL; |
||||
|
||||
DROP TABLE CHAR16_TBL; |
||||
|
||||
DROP TABLE FLOAT4_TBL; |
||||
|
||||
DROP TABLE FLOAT8_TBL; |
||||
|
||||
DROP TABLE INT2_TBL; |
||||
|
||||
DROP TABLE INT4_TBL; |
||||
|
||||
DROP TABLE OID_TBL; |
||||
|
||||
DROP TABLE OIDNAME_TBL; |
||||
|
||||
DROP TABLE OIDINT2_TBL; |
||||
|
||||
DROP TABLE OIDINT4_TBL; |
||||
|
||||
DROP TABLE POINT_TBL; |
||||
|
||||
DROP TABLE POLYGON_TBL; |
||||
|
||||
|
||||
-- |
||||
-- VIRTUAL CLASS REMOVAL |
||||
-- (also tests removal of rewrite rules) |
||||
-- |
||||
DROP VIEW street; |
||||
|
||||
DROP VIEW iexit; |
||||
|
||||
DROP VIEW toyemp; |
||||
|
||||
@ -1,275 +0,0 @@ |
||||
-- |
||||
-- errors.source |
||||
-- |
||||
-- $Header: /cvsroot/pgsql/src/test/regress/Attic/errors.source,v 1.1.1.1 1996/07/09 06:22:24 scrappy Exp $ |
||||
|
||||
|
||||
-- bad in postquel, but ok in postsql |
||||
select 1 |
||||
|
||||
|
||||
-- |
||||
-- UNSUPPORTED STUFF |
||||
|
||||
-- doesn't work |
||||
-- attachas nonesuch |
||||
-- |
||||
-- doesn't work |
||||
-- notify pg_class |
||||
-- |
||||
|
||||
-- |
||||
-- RETRIEVE |
||||
|
||||
-- missing relation name |
||||
select |
||||
|
||||
-- no such relation |
||||
select * from nonesuch; |
||||
|
||||
-- bad name in target list |
||||
select nonesuch from pg_database; |
||||
-- bad attribute name on lhs of operator |
||||
select * from pg_database where nonesuch = pg_database.datname; |
||||
|
||||
-- bad attribute name on rhs of operator |
||||
select * from pg_database where pg_database.datname = nonesuch; |
||||
|
||||
|
||||
-- bad select distinct on syntax, distinct attribute missing |
||||
select distinct on foobar from pg_database; |
||||
|
||||
|
||||
-- bad select distinct on syntax, distinct attribute not in target list |
||||
select distinct on foobar * from pg_database; |
||||
|
||||
|
||||
-- |
||||
-- DELETE |
||||
|
||||
-- missing relation name (this had better not wildcard!) |
||||
delete from; |
||||
|
||||
-- no such relation |
||||
delete from nonesuch; |
||||
|
||||
|
||||
-- |
||||
-- DESTROY |
||||
|
||||
-- missing relation name (this had better not wildcard!) |
||||
drop table; |
||||
|
||||
-- no such relation |
||||
drop table nonesuch; |
||||
|
||||
|
||||
-- |
||||
-- RENAME |
||||
|
||||
|
||||
-- relation renaming |
||||
|
||||
-- missing relation name |
||||
alter table rename; |
||||
|
||||
-- no such relation |
||||
alter table nonesuch rename to newnonesuch; |
||||
|
||||
-- no such relation |
||||
alter table nonesuch rename to stud_emp; |
||||
|
||||
-- system relation |
||||
alter table stud_emp rename to pg_stud_emp; |
||||
|
||||
-- conflict |
||||
alter table stud_emp rename to aggtest; |
||||
|
||||
-- self-conflict |
||||
alter table stud_emp rename to stud_emp; |
||||
|
||||
|
||||
-- attribute renaming |
||||
|
||||
-- no such relation |
||||
alter table nonesuchrel rename column nonesuchatt to newnonesuchatt; |
||||
|
||||
-- no such attribute |
||||
alter table emp rename column nonesuchatt to newnonesuchatt; |
||||
|
||||
-- conflict |
||||
alter table emp rename column salary to manager; |
||||
|
||||
-- conflict |
||||
alter table emp rename column salary to oid; |
||||
|
||||
|
||||
-- |
||||
-- TRANSACTION STUFF |
||||
|
||||
-- not in a xact |
||||
abort; |
||||
|
||||
-- not in a xact |
||||
end; |
||||
|
||||
|
||||
-- |
||||
-- DEFINE AGGREGATE |
||||
|
||||
-- left out finalfunc |
||||
create aggregate newavg1 (sfunc1 = int4pl, |
||||
basetype = int4, |
||||
stype1 = int4, |
||||
sfunc2 = int4inc, |
||||
stype2 = int4, |
||||
initcond1 = '0', |
||||
initcond2 = '0'); |
||||
|
||||
-- sfunc return type disagreement |
||||
create aggregate newavg2 (sfunc1 = int4pl, |
||||
basetype = int4, |
||||
stype1 = int4, |
||||
sfunc2 = int2inc, |
||||
stype2 = int2, |
||||
finalfunc = int4div, |
||||
initcond1 = '0', |
||||
initcond2 = '0'); |
||||
|
||||
-- sfunc/finalfunc type disagreement |
||||
create aggregate newavg3 (sfunc1 = int4pl, |
||||
basetype = int4, |
||||
stype1 = int4, |
||||
sfunc2 = int4inc, |
||||
stype2 = int4, |
||||
finalfunc = int2div, |
||||
initcond1 = '0', |
||||
initcond2 = '0'); |
||||
|
||||
-- left out basetype |
||||
create aggregate newcnt1 (sfunc2 = int4inc, |
||||
stype2 = int4, |
||||
initcond2 = '0'); |
||||
|
||||
-- left out initcond2 (for sfunc2) |
||||
create aggregate newcnt1 (sfunc2 = int4inc, |
||||
basetype = int4, |
||||
stype2 = int4); |
||||
|
||||
|
||||
-- |
||||
-- REMOVE INDEX |
||||
|
||||
-- missing index name |
||||
drop index; |
||||
|
||||
-- bad index name |
||||
drop index 314159; |
||||
|
||||
-- no such index |
||||
drop index nonesuch; |
||||
|
||||
|
||||
-- |
||||
-- REMOVE AGGREGATE |
||||
|
||||
-- missing aggregate name |
||||
drop aggregate; |
||||
|
||||
-- bad aggregate name |
||||
drop aggregate 314159; |
||||
|
||||
-- no such aggregate |
||||
drop aggregate nonesuch; |
||||
|
||||
|
||||
-- |
||||
-- REMOVE FUNCTION |
||||
|
||||
-- missing function name |
||||
drop function (); |
||||
|
||||
-- bad function name |
||||
drop function 314159(); |
||||
|
||||
-- no such function |
||||
drop function nonesuch(); |
||||
|
||||
|
||||
-- |
||||
-- REMOVE TYPE |
||||
|
||||
-- missing type name |
||||
drop type; |
||||
|
||||
-- bad type name |
||||
drop type 314159; |
||||
|
||||
-- no such type |
||||
drop type nonesuch; |
||||
|
||||
|
||||
-- |
||||
-- DROP OPERATOR |
||||
|
||||
-- missing everything |
||||
drop operator; |
||||
|
||||
-- bad operator name |
||||
drop operator equals; |
||||
|
||||
-- missing type list |
||||
drop operator ===; |
||||
|
||||
-- missing parentheses |
||||
drop operator int4, int4; |
||||
|
||||
-- missing operator name |
||||
drop operator (int4, int4); |
||||
|
||||
-- missing type list contents |
||||
drop operator === (); |
||||
|
||||
-- no such operator |
||||
drop operator === (int4); |
||||
|
||||
-- no such operator by that name |
||||
drop operator === (int4, int4); |
||||
|
||||
-- no such type1 |
||||
drop operator = (nonesuch); |
||||
|
||||
-- no such type1 |
||||
drop operator = ( , int4); |
||||
|
||||
-- no such type1 |
||||
drop operator = (nonesuch, int4); |
||||
|
||||
-- no such type2 |
||||
drop operator = (int4, nonesuch); |
||||
|
||||
-- no such type2 |
||||
drop operator = (int4, ); |
||||
|
||||
|
||||
-- |
||||
-- DROP RULE |
||||
|
||||
-- missing rule name |
||||
drop rule; |
||||
|
||||
-- bad rule name |
||||
drop rule 314159; |
||||
|
||||
-- no such rule |
||||
drop rule nonesuch; |
||||
|
||||
-- bad keyword |
||||
drop tuple rule nonesuch; |
||||
|
||||
-- no such rule |
||||
drop instance rule nonesuch; |
||||
|
||||
-- no such rule |
||||
drop rewrite rule nonesuch; |
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,64 +0,0 @@ |
||||
|
||||
-- test this file separately. Be careful the second update statement turns off |
||||
-- super user permission for _USER_. |
||||
|
||||
-- |
||||
-- SECURITY CRUFT |
||||
-- |
||||
UPDATE pg_class |
||||
SET relacl='{}' |
||||
WHERE relname !~ 'pg_*'::text; |
||||
|
||||
UPDATE pg_user |
||||
SET usesuper='f'::bool |
||||
WHERE usename = '_USER_'; |
||||
|
||||
|
||||
CREATE TABLE myclass0 (a int4); |
||||
|
||||
|
||||
-- these should all succeed |
||||
INSERT INTO myclass0 (a) VALUES (5); |
||||
|
||||
SELECT a FROM myclass0; |
||||
|
||||
UPDATE myclass0 SET a=6; |
||||
|
||||
INSERT INTO myclass0 (a) VALUES (10); |
||||
|
||||
INSERT INTO myclass0 (a) VALUES (20); |
||||
|
||||
UPDATE myclass0 SET a=10 WHERE myclass0.a < 10; |
||||
|
||||
UPDATE myclass0 SET a=myclass0.a+1; |
||||
|
||||
DELETE FROM myclass0 WHERE myclass0.a > 15; |
||||
|
||||
CREATE RULE foo AS ON SELECT TO myclass0 DO INSTEAD NOTHING; |
||||
|
||||
DROP RULE foo; |
||||
|
||||
|
||||
CHANGE ACL _USER_-arR myclass0; |
||||
|
||||
|
||||
-- succeeds |
||||
UPDATE myclass0 SET a=1; |
||||
|
||||
-- succeeds (we still have write permission) |
||||
INSERT INTO myclass0 (a) VALUES (100); |
||||
|
||||
-- fails |
||||
select a from myclass0; |
||||
|
||||
-- fails due to read in qualification |
||||
update myclass0 set a = 10 where myclass0.a < 15; |
||||
|
||||
-- fails due to read in target list |
||||
update myclass0 set a = myclass0.a + 1; |
||||
|
||||
-- fails due to read in qualification |
||||
delete from myclass0 where myclass0.a >= 100; |
||||
|
||||
-- fails |
||||
create rule foo as on retrieve to myclass0 do instead nothing; |
||||
Loading…
Reference in new issue