highgo=# select relname,relacl from pg_class where relname='test';
relname | relacl
---------+-------------------------------------------
test | {highgo=arwdDxt/highgo,readonly=r/highgo}
test | {lk=arwdDxt/lk,readonly=r/lk}
(2 rows)
highgo=# select * from INFORMATION_SCHEMA.role_table_grants where grantee='lk';
grantor | grantee | table_catalog | table_schema | table_name | privilege_type | is_grantable | with_hierarchy
---------+---------+---------------+--------------+------------+----------------+--------------+----------------
lk | lk | highgo | lk | test | INSERT | YES | NO
lk | lk | highgo | lk | test | SELECT | YES | YES
lk | lk | highgo | lk | test | UPDATE | YES | NO
lk | lk | highgo | lk | test | DELETE | YES | NO
lk | lk | highgo | lk | test | TRUNCATE | YES | NO
lk | lk | highgo | lk | test | REFERENCES | YES | NO
lk | lk | highgo | lk | test | TRIGGER | YES | NO
(7 rows)
highgo=# select * from INFORMATION_SCHEMA.role_table_grants where grantee='test';
grantor | grantee | table_catalog | table_schema | table_name | privilege_type | is_grantable | with_hierarchy
---------+---------+---------------+--------------+------------+----------------+--------------+----------------
(0 rows)
highgo=# \z test
Access privileges
Schema | Name | Type | Access privileges | Column access privileges
--------+------+-------+-----------------------+--------------------------
public | test | table | highgo=arwdDxt/highgo+|
| | | readonly=r/highgo |
(1 row)
relname | relacl
---------+-------------------------------------------
test | {highgo=arwdDxt/highgo,readonly=r/highgo}
test | {lk=arwdDxt/lk,readonly=r/lk}
(2 rows)
highgo=# select * from INFORMATION_SCHEMA.role_table_grants where grantee='lk';
grantor | grantee | table_catalog | table_schema | table_name | privilege_type | is_grantable | with_hierarchy
---------+---------+---------------+--------------+------------+----------------+--------------+----------------
lk | lk | highgo | lk | test | INSERT | YES | NO
lk | lk | highgo | lk | test | SELECT | YES | YES
lk | lk | highgo | lk | test | UPDATE | YES | NO
lk | lk | highgo | lk | test | DELETE | YES | NO
lk | lk | highgo | lk | test | TRUNCATE | YES | NO
lk | lk | highgo | lk | test | REFERENCES | YES | NO
lk | lk | highgo | lk | test | TRIGGER | YES | NO
(7 rows)
highgo=# select * from INFORMATION_SCHEMA.role_table_grants where grantee='test';
grantor | grantee | table_catalog | table_schema | table_name | privilege_type | is_grantable | with_hierarchy
---------+---------+---------------+--------------+------------+----------------+--------------+----------------
(0 rows)
highgo=# \z test
Access privileges
Schema | Name | Type | Access privileges | Column access privileges
--------+------+-------+-----------------------+--------------------------
public | test | table | highgo=arwdDxt/highgo+|
| | | readonly=r/highgo |
(1 row)

中查看用户对表的操作权限&spm=1001.2101.3001.5002&articleId=78214819&d=1&t=3&u=b7e6cfa1b3474c3cb8196346ed7dd749)
6854

被折叠的 条评论
为什么被折叠?



