postgres=# selecthas_database_privilege('test','postgres','temp');has_database_privilege---t(1row)postgres=# postgres=# selecthas_database_privilege('test','postgres','temporary');has_database_privilege---t(1row)postgres=# postgres=# selecthas_database_privilege('test','postgres','create...
select pg_size_pretty('database'); 1. 统计各个数据库大小 SELECT d.datname AS Name, pg_catalog.pg_get_userbyid(d.datdba) AS Owner, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)) ELSE 'No ...
d.datctype as "Ctype", pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges", CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)) ELSE 'No Access' END as "Size", t.spcname as...
(一)概念的区分 Postgresql的官方文档上对于role的定义是A role is an entity that can own database objectsand have database privileges; a role can be considered a "user",a "group", or both depending on how it isused.意思是一个角色是一个可以有自己的数据库对象和数据库操纵权限的实体,一个角色...
FROM pg_catalog.pg_database d ORDER BY CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE NULL END DESC -- nulls first LIMIT 20 1. 2. 3. 4. 5. 6. 7. 8. ...
PostgreSQL 中使用 aclitem 来表示一个具体的数据库对象上的权限。对于 database 和 schema,aclitem 存储在 pg_database.datacl 和 pg_namespace.nspacl 中,对于 table,view 等其他数据库对象,pg_class.relacl 中保存了 aclitem 的一个 list。对于列级别的权限,aclitem 将保存在 pg_attribute.attacl 中。
DatabasePrivilege 指定账号对数据库对象拥有的权限列表 被如下接口引用:DescribeAccountPrivileges, ModifyAccountPrivileges。 名称类型必选描述 Object DatabaseObject 否 数据库对象,当ObjectType为database时,DataseName/SchemaName/TableName可为空;当ObjectType为schema时,SchemaName/TableName可为空;当ObjectType为colum...
pg_catalog | has_database_privilege | boolean |name, oid, text pg_catalog | has_database_privilege | boolean |name, text, text pg_catalog | has_database_privilege | boolean | oid, oid, text pg_catalog | has_database_privilege | boolean | oid, text ...
postgres@HQ-SIT-kafka013:5432/postgres=# \c test dlq16050FATAL: permission deniedfordatabase"test"DETAIL:UserdoesnothaveCONNECTprivilege.Previous connection kept 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 用户dlq16050已经没有登录test数据库的权限了。
Invalid operation: user "user1" cannot be dropped because the user has a privilege on some object; ERROR: role "role1" cannot be dropped because some objects depend on it select * from information_schema.table_privileges where grantee='XX';--查到XX对所有表的对象权限,但是查不到select on ...