mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Follow the rule that regression-test-created roles are named "regress_xxx".
contrib/amcheck didn't get the memo either.
This commit is contained in:
@ -5,9 +5,9 @@ INSERT INTO bttest_a SELECT * FROM generate_series(1, 100000);
|
|||||||
INSERT INTO bttest_b SELECT * FROM generate_series(100000, 1, -1);
|
INSERT INTO bttest_b SELECT * FROM generate_series(100000, 1, -1);
|
||||||
CREATE INDEX bttest_a_idx ON bttest_a USING btree (id);
|
CREATE INDEX bttest_a_idx ON bttest_a USING btree (id);
|
||||||
CREATE INDEX bttest_b_idx ON bttest_b USING btree (id);
|
CREATE INDEX bttest_b_idx ON bttest_b USING btree (id);
|
||||||
CREATE ROLE bttest_role;
|
CREATE ROLE regress_bttest_role;
|
||||||
-- verify permissions are checked (error due to function not callable)
|
-- verify permissions are checked (error due to function not callable)
|
||||||
SET ROLE bttest_role;
|
SET ROLE regress_bttest_role;
|
||||||
SELECT bt_index_check('bttest_a_idx'::regclass);
|
SELECT bt_index_check('bttest_a_idx'::regclass);
|
||||||
ERROR: permission denied for function bt_index_check
|
ERROR: permission denied for function bt_index_check
|
||||||
SELECT bt_index_parent_check('bttest_a_idx'::regclass);
|
SELECT bt_index_parent_check('bttest_a_idx'::regclass);
|
||||||
@ -16,9 +16,9 @@ RESET ROLE;
|
|||||||
-- we, intentionally, don't check relation permissions - it's useful
|
-- we, intentionally, don't check relation permissions - it's useful
|
||||||
-- to run this cluster-wide with a restricted account, and as tested
|
-- to run this cluster-wide with a restricted account, and as tested
|
||||||
-- above explicit permission has to be granted for that.
|
-- above explicit permission has to be granted for that.
|
||||||
GRANT EXECUTE ON FUNCTION bt_index_check(regclass) TO bttest_role;
|
GRANT EXECUTE ON FUNCTION bt_index_check(regclass) TO regress_bttest_role;
|
||||||
GRANT EXECUTE ON FUNCTION bt_index_parent_check(regclass) TO bttest_role;
|
GRANT EXECUTE ON FUNCTION bt_index_parent_check(regclass) TO regress_bttest_role;
|
||||||
SET ROLE bttest_role;
|
SET ROLE regress_bttest_role;
|
||||||
SELECT bt_index_check('bttest_a_idx');
|
SELECT bt_index_check('bttest_a_idx');
|
||||||
bt_index_check
|
bt_index_check
|
||||||
----------------
|
----------------
|
||||||
@ -88,5 +88,5 @@ COMMIT;
|
|||||||
-- cleanup
|
-- cleanup
|
||||||
DROP TABLE bttest_a;
|
DROP TABLE bttest_a;
|
||||||
DROP TABLE bttest_b;
|
DROP TABLE bttest_b;
|
||||||
DROP OWNED BY bttest_role; -- permissions
|
DROP OWNED BY regress_bttest_role; -- permissions
|
||||||
DROP ROLE bttest_role;
|
DROP ROLE regress_bttest_role;
|
||||||
|
@ -8,10 +8,10 @@ INSERT INTO bttest_b SELECT * FROM generate_series(100000, 1, -1);
|
|||||||
CREATE INDEX bttest_a_idx ON bttest_a USING btree (id);
|
CREATE INDEX bttest_a_idx ON bttest_a USING btree (id);
|
||||||
CREATE INDEX bttest_b_idx ON bttest_b USING btree (id);
|
CREATE INDEX bttest_b_idx ON bttest_b USING btree (id);
|
||||||
|
|
||||||
CREATE ROLE bttest_role;
|
CREATE ROLE regress_bttest_role;
|
||||||
|
|
||||||
-- verify permissions are checked (error due to function not callable)
|
-- verify permissions are checked (error due to function not callable)
|
||||||
SET ROLE bttest_role;
|
SET ROLE regress_bttest_role;
|
||||||
SELECT bt_index_check('bttest_a_idx'::regclass);
|
SELECT bt_index_check('bttest_a_idx'::regclass);
|
||||||
SELECT bt_index_parent_check('bttest_a_idx'::regclass);
|
SELECT bt_index_parent_check('bttest_a_idx'::regclass);
|
||||||
RESET ROLE;
|
RESET ROLE;
|
||||||
@ -19,9 +19,9 @@ RESET ROLE;
|
|||||||
-- we, intentionally, don't check relation permissions - it's useful
|
-- we, intentionally, don't check relation permissions - it's useful
|
||||||
-- to run this cluster-wide with a restricted account, and as tested
|
-- to run this cluster-wide with a restricted account, and as tested
|
||||||
-- above explicit permission has to be granted for that.
|
-- above explicit permission has to be granted for that.
|
||||||
GRANT EXECUTE ON FUNCTION bt_index_check(regclass) TO bttest_role;
|
GRANT EXECUTE ON FUNCTION bt_index_check(regclass) TO regress_bttest_role;
|
||||||
GRANT EXECUTE ON FUNCTION bt_index_parent_check(regclass) TO bttest_role;
|
GRANT EXECUTE ON FUNCTION bt_index_parent_check(regclass) TO regress_bttest_role;
|
||||||
SET ROLE bttest_role;
|
SET ROLE regress_bttest_role;
|
||||||
SELECT bt_index_check('bttest_a_idx');
|
SELECT bt_index_check('bttest_a_idx');
|
||||||
SELECT bt_index_parent_check('bttest_a_idx');
|
SELECT bt_index_parent_check('bttest_a_idx');
|
||||||
RESET ROLE;
|
RESET ROLE;
|
||||||
@ -57,5 +57,5 @@ COMMIT;
|
|||||||
-- cleanup
|
-- cleanup
|
||||||
DROP TABLE bttest_a;
|
DROP TABLE bttest_a;
|
||||||
DROP TABLE bttest_b;
|
DROP TABLE bttest_b;
|
||||||
DROP OWNED BY bttest_role; -- permissions
|
DROP OWNED BY regress_bttest_role; -- permissions
|
||||||
DROP ROLE bttest_role;
|
DROP ROLE regress_bttest_role;
|
||||||
|
Reference in New Issue
Block a user