mirror of https://github.com/citusdata/citus.git
PG16 - Add reindex database/system tests (#7167)
In PG16, REINDEX DATABASE/SYSTEM name is optional. We already don't propagate these commands automatically. Testing here with run_command_on_workers. Relevant PG commit: https://github.com/postgres/postgres/commit/2cbc3c1pg16_grant_inherit_set
parent
1148698c99
commit
48870c58cd
|
@ -654,6 +654,28 @@ SELECT pg_get_viewdef('pg16.prop_view_1', true);
|
|||
|
||||
\c - - - :master_port
|
||||
SET search_path TO pg16;
|
||||
-- REINDEX DATABASE/SYSTEM name is optional
|
||||
-- We already don't propagate these commands automatically
|
||||
-- Testing here with run_command_on_workers
|
||||
-- Relevant PG commit: https://github.com/postgres/postgres/commit/2cbc3c1
|
||||
REINDEX DATABASE;
|
||||
SELECT result FROM run_command_on_workers
|
||||
($$REINDEX DATABASE$$);
|
||||
result
|
||||
---------------------------------------------------------------------
|
||||
REINDEX
|
||||
REINDEX
|
||||
(2 rows)
|
||||
|
||||
REINDEX SYSTEM;
|
||||
SELECT result FROM run_command_on_workers
|
||||
($$REINDEX SYSTEM$$);
|
||||
result
|
||||
---------------------------------------------------------------------
|
||||
REINDEX
|
||||
REINDEX
|
||||
(2 rows)
|
||||
|
||||
\set VERBOSITY terse
|
||||
SET client_min_messages TO ERROR;
|
||||
DROP SCHEMA pg16 CASCADE;
|
||||
|
|
|
@ -375,35 +375,18 @@ SELECT pg_get_viewdef('pg16.prop_view_1', true);
|
|||
\c - - - :master_port
|
||||
SET search_path TO pg16;
|
||||
|
||||
--
|
||||
-- PG16 allows GRANT WITH ADMIN | INHERIT | SET
|
||||
--
|
||||
-- GRANT privileges to a role or roles
|
||||
\c - - - :master_port
|
||||
CREATE ROLE create_role;
|
||||
CREATE ROLE create_role_2;
|
||||
CREATE ROLE create_role_3;
|
||||
CREATE ROLE create_role_4;
|
||||
CREATE USER create_user;
|
||||
CREATE USER create_user_2;
|
||||
CREATE GROUP create_group;
|
||||
CREATE GROUP create_group_2;
|
||||
-- REINDEX DATABASE/SYSTEM name is optional
|
||||
-- We already don't propagate these commands automatically
|
||||
-- Testing here with run_command_on_workers
|
||||
-- Relevant PG commit: https://github.com/postgres/postgres/commit/2cbc3c1
|
||||
|
||||
--test grant role
|
||||
GRANT create_group TO create_role;
|
||||
GRANT create_group TO create_role_2 WITH ADMIN OPTION;
|
||||
GRANT create_group TO create_role_3 WITH INHERIT;
|
||||
GRANT create_group TO create_role_4 WITH SET;
|
||||
|
||||
-- ADMIN role can perfom administrative tasks
|
||||
-- role can now access the data and permissions of the table (owner of table)
|
||||
-- role can change current user to any other user/role that has access
|
||||
GRANT ADMIN TO joe;
|
||||
GRANT INHERIT ON ROLE joe TO james;
|
||||
|
||||
GRANT SELECT ON companies TO joe WITH GRANT OPTION;
|
||||
GRANT SET (SELECT) ON companies TO james;
|
||||
REINDEX DATABASE;
|
||||
SELECT result FROM run_command_on_workers
|
||||
($$REINDEX DATABASE$$);
|
||||
|
||||
REINDEX SYSTEM;
|
||||
SELECT result FROM run_command_on_workers
|
||||
($$REINDEX SYSTEM$$);
|
||||
|
||||
\set VERBOSITY terse
|
||||
SET client_min_messages TO ERROR;
|
||||
|
|
Loading…
Reference in New Issue