1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

sepgsql DROP support.

KaiGai Kohei
This commit is contained in:
Robert Haas
2012-03-09 15:18:45 -05:00
parent 07d1edb954
commit e914a144d3
11 changed files with 483 additions and 88 deletions

View File

@ -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'
);
--
-- clean-up
--
DROP DATABASE IF EXISTS regtest_sepgsql_test_database;
-- 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;
--
-- DROP Permission checks (with clean-up)
--
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;