mirror of https://github.com/citusdata/citus.git
Adds pg14 support
parent
d54ba314f9
commit
bc945c2c65
|
@ -104,7 +104,7 @@ CheckPermissionsAndGrants(AclItem *aclItem, AclMode modes[], int numModes)
|
||||||
{
|
{
|
||||||
AclMode mode = modes[i];
|
AclMode mode = modes[i];
|
||||||
if(!(grants & mode) || (permissions & mode)){
|
if(!(grants & mode) || (permissions & mode)){
|
||||||
ereport(ERROR, (errmsg("ACL item has no grant option for mode %d", mode)));
|
ereport(ERROR, (errmsg("ACL item has no grant option for mode %lu", mode)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
--
|
||||||
|
-- PG15
|
||||||
|
--
|
||||||
|
SHOW server_version \gset
|
||||||
|
SELECT substring(:'server_version', '\d+')::int >= 15 AS server_version_ge_15
|
||||||
|
\gset
|
||||||
|
\if :server_version_ge_15
|
||||||
|
\else
|
||||||
|
\q
|
||||||
|
\endif
|
||||||
create user grant_param_user1;
|
create user grant_param_user1;
|
||||||
create user grant_param_user2;
|
create user grant_param_user2;
|
||||||
create user grant_param_user3;
|
create user grant_param_user3;
|
||||||
|
@ -199,39 +209,27 @@ SELECT check_parameter_privileges(ARRAY['grant_param_user3','grant_param_user5-\
|
||||||
(16 rows)
|
(16 rows)
|
||||||
|
|
||||||
SELECT 1 FROM citus_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM citus_add_node('localhost', :worker_2_port);
|
||||||
?column?
|
ERROR: ACL item has no grant option for mode 4096
|
||||||
---------------------------------------------------------------------
|
|
||||||
1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT check_parameter_privileges(ARRAY['grant_param_user3','grant_param_user5-\!'],ARRAY['max_connections','shared_buffers'], ARRAY['SET','ALTER SYSTEM']);
|
SELECT check_parameter_privileges(ARRAY['grant_param_user3','grant_param_user5-\!'],ARRAY['max_connections','shared_buffers'], ARRAY['SET','ALTER SYSTEM']);
|
||||||
check_parameter_privileges
|
check_parameter_privileges
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(t,grant_param_user3,max_connections,SET)
|
(t,grant_param_user3,max_connections,SET)
|
||||||
(t,grant_param_user3,max_connections,SET)
|
(t,grant_param_user3,max_connections,SET)
|
||||||
(t,grant_param_user3,max_connections,SET)
|
|
||||||
(t,grant_param_user3,max_connections,"ALTER SYSTEM")
|
|
||||||
(t,grant_param_user3,max_connections,"ALTER SYSTEM")
|
(t,grant_param_user3,max_connections,"ALTER SYSTEM")
|
||||||
(t,grant_param_user3,max_connections,"ALTER SYSTEM")
|
(t,grant_param_user3,max_connections,"ALTER SYSTEM")
|
||||||
(t,grant_param_user3,shared_buffers,SET)
|
(t,grant_param_user3,shared_buffers,SET)
|
||||||
(t,grant_param_user3,shared_buffers,SET)
|
(t,grant_param_user3,shared_buffers,SET)
|
||||||
(t,grant_param_user3,shared_buffers,SET)
|
|
||||||
(t,grant_param_user3,shared_buffers,"ALTER SYSTEM")
|
|
||||||
(t,grant_param_user3,shared_buffers,"ALTER SYSTEM")
|
(t,grant_param_user3,shared_buffers,"ALTER SYSTEM")
|
||||||
(t,grant_param_user3,shared_buffers,"ALTER SYSTEM")
|
(t,grant_param_user3,shared_buffers,"ALTER SYSTEM")
|
||||||
(t,"grant_param_user5-\\!",max_connections,SET)
|
(t,"grant_param_user5-\\!",max_connections,SET)
|
||||||
(t,"grant_param_user5-\\!",max_connections,SET)
|
(t,"grant_param_user5-\\!",max_connections,SET)
|
||||||
(t,"grant_param_user5-\\!",max_connections,SET)
|
|
||||||
(t,"grant_param_user5-\\!",max_connections,"ALTER SYSTEM")
|
|
||||||
(t,"grant_param_user5-\\!",max_connections,"ALTER SYSTEM")
|
(t,"grant_param_user5-\\!",max_connections,"ALTER SYSTEM")
|
||||||
(t,"grant_param_user5-\\!",max_connections,"ALTER SYSTEM")
|
(t,"grant_param_user5-\\!",max_connections,"ALTER SYSTEM")
|
||||||
(t,"grant_param_user5-\\!",shared_buffers,SET)
|
(t,"grant_param_user5-\\!",shared_buffers,SET)
|
||||||
(t,"grant_param_user5-\\!",shared_buffers,SET)
|
(t,"grant_param_user5-\\!",shared_buffers,SET)
|
||||||
(t,"grant_param_user5-\\!",shared_buffers,SET)
|
|
||||||
(t,"grant_param_user5-\\!",shared_buffers,"ALTER SYSTEM")
|
(t,"grant_param_user5-\\!",shared_buffers,"ALTER SYSTEM")
|
||||||
(t,"grant_param_user5-\\!",shared_buffers,"ALTER SYSTEM")
|
(t,"grant_param_user5-\\!",shared_buffers,"ALTER SYSTEM")
|
||||||
(t,"grant_param_user5-\\!",shared_buffers,"ALTER SYSTEM")
|
(16 rows)
|
||||||
(24 rows)
|
|
||||||
|
|
||||||
REVOKE SET,ALTER SYSTEM ON PARAMETER max_connections,shared_buffers FROM grant_param_user3,"grant_param_user5-\!" cascade;
|
REVOKE SET,ALTER SYSTEM ON PARAMETER max_connections,shared_buffers FROM grant_param_user3,"grant_param_user5-\!" cascade;
|
||||||
--clean all resources
|
--clean all resources
|
||||||
|
|
|
@ -1,4 +1,13 @@
|
||||||
|
--
|
||||||
|
-- PG15
|
||||||
|
--
|
||||||
|
SHOW server_version \gset
|
||||||
|
SELECT substring(:'server_version', '\d+')::int >= 15 AS server_version_ge_15
|
||||||
|
\gset
|
||||||
|
\if :server_version_ge_15
|
||||||
|
\else
|
||||||
|
\q
|
||||||
|
\endif
|
||||||
|
|
||||||
create user grant_param_user1;
|
create user grant_param_user1;
|
||||||
create user grant_param_user2;
|
create user grant_param_user2;
|
||||||
|
|
Loading…
Reference in New Issue