Grant create on public to some users where necessary (for PG15) (#6180)

pull/6176/head
Naisila Puka 2022-08-17 17:35:10 +03:00 committed by GitHub
parent 3f6ce889eb
commit 20a0e0ed39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,7 @@ insert into no_access values(2);
insert into no_access values(3);
select current_user \gset
create user columnar_user;
GRANT CREATE ON SCHEMA public TO columnar_user;
\c - columnar_user
-- owned by columnar_user
create table columnar_permissions(i int) using columnar;

View File

@ -155,6 +155,7 @@ SELECT COUNT(*) FROM wonderland;
(1 row)
DROP TABLE wonderland;
GRANT CREATE ON SCHEMA public TO bob;
\c :bob_conninfo
-- bob can't change authinfo: not a superuser
DELETE FROM pg_dist_authinfo WHERE rolename = 'bob';

View File

@ -161,6 +161,7 @@ SELECT master_create_distributed_table('trivial_postgres', 'id', 'append');
(1 row)
GRANT ALL ON trivial_postgres TO full_access;
GRANT CREATE ON SCHEMA public TO full_access;
SET ROLE full_access;
CREATE TABLE trivial_full_access (id int);
SELECT master_create_distributed_table('trivial_full_access', 'id', 'append');

View File

@ -7,6 +7,8 @@ setup
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);
ALTER TABLE test_table OWNER TO test_user_1;
SELECT create_distributed_table('test_table', 'column1');
@ -16,6 +18,7 @@ teardown
{
BEGIN;
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;
COMMIT;
}

View File

@ -9,6 +9,8 @@ select current_user \gset
create user columnar_user;
GRANT CREATE ON SCHEMA public TO columnar_user;
\c - columnar_user
-- owned by columnar_user

View File

@ -135,6 +135,8 @@ SELECT COUNT(*) FROM wonderland;
DROP TABLE wonderland;
GRANT CREATE ON SCHEMA public TO bob;
\c :bob_conninfo
-- bob can't change authinfo: not a superuser

View File

@ -43,6 +43,8 @@ CREATE TABLE trivial_postgres (id int);
SELECT master_create_distributed_table('trivial_postgres', 'id', 'append');
GRANT ALL ON trivial_postgres TO full_access;
GRANT CREATE ON SCHEMA public TO full_access;
SET ROLE full_access;
CREATE TABLE trivial_full_access (id int);
SELECT master_create_distributed_table('trivial_full_access', 'id', 'append');