|
| 1 | +CREATE ROLE regress_mdb_superuser_user1; |
| 2 | +CREATE ROLE regress_mdb_superuser_user2; |
| 3 | +CREATE ROLE regress_mdb_superuser_user3; |
| 4 | +CREATE ROLE regress_superuser WITH SUPERUSER; |
| 5 | +GRANT mdb_superuser TO regress_mdb_superuser_user1; |
| 6 | +GRANT CREATE ON DATABASE regression TO regress_mdb_superuser_user2; |
| 7 | +SET ROLE regress_superuser; |
| 8 | +CREATE TABLE regress_superuser_table(); |
| 9 | +SET ROLE pg_read_server_files; |
| 10 | +CREATE TABLE regress_pgrsf_table(); |
| 11 | +SET ROLE pg_write_server_files; |
| 12 | +CREATE TABLE regress_pgwsf_table(); |
| 13 | +SET ROLE pg_execute_server_program; |
| 14 | +CREATE TABLE regress_pgxsp_table(); |
| 15 | +SET ROLE pg_read_all_data; |
| 16 | +CREATE TABLE regress_pgrad_table(); |
| 17 | +SET ROLE pg_write_all_data; |
| 18 | +CREATE TABLE regress_pgrwd_table(); |
| 19 | +SET ROLE regress_mdb_superuser_user1; |
| 20 | +CREATE TABLE regress_mdbsu_table(); |
| 21 | +SET ROLE regress_mdb_superuser_user2; |
| 22 | +CREATE TABLE regress_mdbsu_table2(); |
| 23 | +SET ROLE mdb_read_all_data; |
| 24 | +-- cannot read all data (fail) |
| 25 | +TABLE pg_authid; |
| 26 | +ERROR: permission denied for table pg_authid |
| 27 | +TABLE regress_superuser_table; |
| 28 | +ERROR: permission denied for table regress_superuser_table |
| 29 | +TABLE regress_pgrsf_table; |
| 30 | +ERROR: permission denied for table regress_pgrsf_table |
| 31 | +TABLE regress_pgwsf_table; |
| 32 | +ERROR: permission denied for table regress_pgwsf_table |
| 33 | +TABLE regress_pgxsp_table; |
| 34 | +ERROR: permission denied for table regress_pgxsp_table |
| 35 | +TABLE regress_pgrad_table; |
| 36 | +ERROR: permission denied for table regress_pgrad_table |
| 37 | +TABLE regress_pgwsf_table; |
| 38 | +ERROR: permission denied for table regress_pgwsf_table |
| 39 | +-- is allow to read all other data |
| 40 | +TABLE regress_mdbsu_table; |
| 41 | +-- |
| 42 | +(0 rows) |
| 43 | + |
| 44 | +TABLE regress_mdbsu_table2; |
| 45 | +-- |
| 46 | +(0 rows) |
| 47 | + |
| 48 | +SET ROLE mdb_write_all_data; |
| 49 | +CREATE TABLE regress_tt_dat(); |
| 50 | +-- cannot read all data (fail) |
| 51 | +INSERT INTO regress_superuser_table TABLE regress_tt_dat; |
| 52 | +ERROR: permission denied for table regress_superuser_table |
| 53 | +INSERT INTO regress_pgrsf_table TABLE regress_tt_dat; |
| 54 | +ERROR: permission denied for table regress_pgrsf_table |
| 55 | +INSERT INTO regress_pgwsf_table TABLE regress_tt_dat; |
| 56 | +ERROR: permission denied for table regress_pgwsf_table |
| 57 | +INSERT INTO regress_pgxsp_table TABLE regress_tt_dat; |
| 58 | +ERROR: permission denied for table regress_pgxsp_table |
| 59 | +INSERT INTO regress_pgrad_table TABLE regress_tt_dat; |
| 60 | +ERROR: permission denied for table regress_pgrad_table |
| 61 | +INSERT INTO regress_pgwsf_table TABLE regress_tt_dat; |
| 62 | +ERROR: permission denied for table regress_pgwsf_table |
| 63 | +-- is allow to read all other data |
| 64 | +INSERT INTO regress_mdbsu_table TABLE regress_tt_dat; |
| 65 | +INSERT INTO regress_mdbsu_table2 TABLE regress_tt_dat; |
| 66 | +-- end tests |
| 67 | +RESET SESSION AUTHORIZATION; |
| 68 | +-- |
| 69 | +DROP TABLE regress_pgrsf_table; |
| 70 | +DROP TABLE regress_pgwsf_table; |
| 71 | +DROP TABLE regress_pgxsp_table; |
| 72 | +DROP TABLE regress_pgrad_table; |
| 73 | +DROP TABLE regress_pgrwd_table; |
| 74 | +DROP TABLE regress_mdbsu_table; |
| 75 | +DROP TABLE regress_mdbsu_table2; |
| 76 | +DROP TABLE regress_superuser_table; |
| 77 | +REVOKE CREATE ON DATABASE regression FROM regress_mdb_superuser_user2; |
| 78 | +REVOKE CREATE ON DATABASE regression FROM regress_mdb_superuser_user3; |
| 79 | +DROP ROLE regress_mdb_superuser_user1; |
| 80 | +DROP ROLE regress_mdb_superuser_user2; |
| 81 | +DROP ROLE regress_mdb_superuser_user3; |
| 82 | +DROP ROLE regress_superuser; |
0 commit comments