diff options
| author | Robert Haas | 2012-03-09 20:18:45 +0000 |
|---|---|---|
| committer | Robert Haas | 2012-03-09 20:18:45 +0000 |
| commit | e914a144d3aaa0a09e0aab031d7e6f58389401ce (patch) | |
| tree | 09d5d2c29e546764eb0562067ab3359ce2e4f9d6 /contrib/sepgsql/sql | |
| parent | 07d1edb954bc8f5d0e2c010dec8482328af38cb8 (diff) | |
sepgsql DROP support.
KaiGai Kohei
Diffstat (limited to 'contrib/sepgsql/sql')
| -rw-r--r-- | contrib/sepgsql/sql/ddl.sql (renamed from contrib/sepgsql/sql/create.sql) | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/contrib/sepgsql/sql/create.sql b/contrib/sepgsql/sql/ddl.sql index b0695b41a9..8dd57e0eaf 100644 --- a/contrib/sepgsql/sql/create.sql +++ b/contrib/sepgsql/sql/ddl.sql @@ -1,5 +1,5 @@ -- --- Regression Test for Creation of Object Permission Checks +-- Regression Test for DDL of Object Permission Checks -- -- confirm required permissions using audit messages @@ -7,10 +7,17 @@ SET sepgsql.debug_audit = true; SET client_min_messages = LOG; +-- +-- CREATE Permission checks +-- CREATE DATABASE regtest_sepgsql_test_database; +CREATE USER regtest_sepgsql_test_user; + CREATE SCHEMA regtest_schema; +GRANT ALL ON SCHEMA regtest_schema TO regtest_sepgsql_test_user; + SET search_path = regtest_schema, public; CREATE TABLE regtest_table (x serial primary key, y text); @@ -38,9 +45,37 @@ CREATE AGGREGATE regtest_agg ( sfunc1 = int4pl, basetype = int4, stype1 = int4, initcond1 = '0' ); +-- CREATE objects owned by others +SET SESSION AUTHORIZATION regtest_sepgsql_test_user; + +SET search_path = regtest_schema, public; + +CREATE TABLE regtest_table_3 (x int, y serial); + +CREATE VIEW regtest_view_2 AS SELECT * FROM regtest_table_3 WHERE x < y; + +CREATE FUNCTION regtest_func_2(int) RETURNS bool LANGUAGE plpgsql + AS 'BEGIN RETURN $1 * $1 < 100; END'; + +RESET SESSION AUTHORIZATION; + -- --- clean-up +-- DROP Permission checks (with clean-up) -- -DROP DATABASE IF EXISTS regtest_sepgsql_test_database; +DROP FUNCTION regtest_func(text,int[]); +DROP AGGREGATE regtest_agg(int); + +DROP SEQUENCE regtest_seq; +DROP VIEW regtest_view; + +ALTER TABLE regtest_table DROP COLUMN y; +ALTER TABLE regtest_table_2 SET WITHOUT OIDS; + +DROP TABLE regtest_table; + +DROP OWNED BY regtest_sepgsql_test_user; + +DROP DATABASE regtest_sepgsql_test_database; +DROP USER regtest_sepgsql_test_user; DROP SCHEMA IF EXISTS regtest_schema CASCADE; |
