mirror of https://github.com/citusdata/citus.git
Grant create on public to some users where necessary (for PG15) (#6180)
parent
3f6ce889eb
commit
20a0e0ed39
|
@ -4,6 +4,7 @@ insert into no_access values(2);
|
||||||
insert into no_access values(3);
|
insert into no_access values(3);
|
||||||
select current_user \gset
|
select current_user \gset
|
||||||
create user columnar_user;
|
create user columnar_user;
|
||||||
|
GRANT CREATE ON SCHEMA public TO columnar_user;
|
||||||
\c - columnar_user
|
\c - columnar_user
|
||||||
-- owned by columnar_user
|
-- owned by columnar_user
|
||||||
create table columnar_permissions(i int) using columnar;
|
create table columnar_permissions(i int) using columnar;
|
||||||
|
|
|
@ -155,6 +155,7 @@ SELECT COUNT(*) FROM wonderland;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
DROP TABLE wonderland;
|
DROP TABLE wonderland;
|
||||||
|
GRANT CREATE ON SCHEMA public TO bob;
|
||||||
\c :bob_conninfo
|
\c :bob_conninfo
|
||||||
-- bob can't change authinfo: not a superuser
|
-- bob can't change authinfo: not a superuser
|
||||||
DELETE FROM pg_dist_authinfo WHERE rolename = 'bob';
|
DELETE FROM pg_dist_authinfo WHERE rolename = 'bob';
|
||||||
|
|
|
@ -161,6 +161,7 @@ SELECT master_create_distributed_table('trivial_postgres', 'id', 'append');
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
GRANT ALL ON trivial_postgres TO full_access;
|
GRANT ALL ON trivial_postgres TO full_access;
|
||||||
|
GRANT CREATE ON SCHEMA public TO full_access;
|
||||||
SET ROLE full_access;
|
SET ROLE full_access;
|
||||||
CREATE TABLE trivial_full_access (id int);
|
CREATE TABLE trivial_full_access (id int);
|
||||||
SELECT master_create_distributed_table('trivial_full_access', 'id', 'append');
|
SELECT master_create_distributed_table('trivial_full_access', 'id', 'append');
|
||||||
|
|
|
@ -7,6 +7,8 @@ setup
|
||||||
|
|
||||||
CREATE USER test_user_2;
|
CREATE USER test_user_2;
|
||||||
|
|
||||||
|
GRANT CREATE ON SCHEMA public TO test_user_1, test_user_2;
|
||||||
|
|
||||||
CREATE TABLE test_table(column1 int, column2 int);
|
CREATE TABLE test_table(column1 int, column2 int);
|
||||||
ALTER TABLE test_table OWNER TO test_user_1;
|
ALTER TABLE test_table OWNER TO test_user_1;
|
||||||
SELECT create_distributed_table('test_table', 'column1');
|
SELECT create_distributed_table('test_table', 'column1');
|
||||||
|
@ -16,6 +18,7 @@ teardown
|
||||||
{
|
{
|
||||||
BEGIN;
|
BEGIN;
|
||||||
DROP TABLE IF EXISTS test_table;
|
DROP TABLE IF EXISTS test_table;
|
||||||
|
REVOKE CREATE ON SCHEMA public FROM test_user_1, test_user_2;
|
||||||
DROP USER test_user_1, test_user_2;
|
DROP USER test_user_1, test_user_2;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@ select current_user \gset
|
||||||
|
|
||||||
create user columnar_user;
|
create user columnar_user;
|
||||||
|
|
||||||
|
GRANT CREATE ON SCHEMA public TO columnar_user;
|
||||||
|
|
||||||
\c - columnar_user
|
\c - columnar_user
|
||||||
|
|
||||||
-- owned by columnar_user
|
-- owned by columnar_user
|
||||||
|
|
|
@ -135,6 +135,8 @@ SELECT COUNT(*) FROM wonderland;
|
||||||
|
|
||||||
DROP TABLE wonderland;
|
DROP TABLE wonderland;
|
||||||
|
|
||||||
|
GRANT CREATE ON SCHEMA public TO bob;
|
||||||
|
|
||||||
\c :bob_conninfo
|
\c :bob_conninfo
|
||||||
|
|
||||||
-- bob can't change authinfo: not a superuser
|
-- bob can't change authinfo: not a superuser
|
||||||
|
|
|
@ -43,6 +43,8 @@ CREATE TABLE trivial_postgres (id int);
|
||||||
SELECT master_create_distributed_table('trivial_postgres', 'id', 'append');
|
SELECT master_create_distributed_table('trivial_postgres', 'id', 'append');
|
||||||
GRANT ALL ON trivial_postgres TO full_access;
|
GRANT ALL ON trivial_postgres TO full_access;
|
||||||
|
|
||||||
|
GRANT CREATE ON SCHEMA public TO full_access;
|
||||||
|
|
||||||
SET ROLE full_access;
|
SET ROLE full_access;
|
||||||
CREATE TABLE trivial_full_access (id int);
|
CREATE TABLE trivial_full_access (id int);
|
||||||
SELECT master_create_distributed_table('trivial_full_access', 'id', 'append');
|
SELECT master_create_distributed_table('trivial_full_access', 'id', 'append');
|
||||||
|
|
Loading…
Reference in New Issue