检查用户的Postgres访问权限 [英] Check Postgres access for a user
问题描述
我已经查看了
I have looked into the documentation for GRANT
Found here and I was trying to see if there is a built-in function that can let me look at what level of accessibility I have in databases. Of course there is:
\dp
和 \dp mytablename
但这不显示我的帐户可以访问的内容。我想查看我有权访问的所有表。谁能告诉我是否有一个命令可以检查我在Postgres中的访问权限(是否我有 SELECT
, INSERT
,删除
,更新
权限)?如果是这样,该命令将是什么?
But this does not show what my account has access to. I would like to see ALL the tables I have access to. Can anyone tell me if there is a command that can check my level of access in Postgres (whether I have SELECT
, INSERT
, DELETE
, UPDATE
privileges)? And if so, what would that command be?
推荐答案
您可以查询 table_privileges $ c信息模式中的$ c>表:
SELECT table_catalog, table_schema, table_name, privilege_type
FROM information_schema.table_privileges
WHERE grantee = 'MY_USER'
这篇关于检查用户的Postgres访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!