postgresql - view schema privileges

后端 未结 9 2016
再見小時候
再見小時候 2020-12-24 12:17

Is there a query I can run to show currently assigned privileges on a particular schema?

i.e. privileges that were assigned like so:

GRANT USAGE ON S         


        
9条回答
  •  不知归路
    2020-12-24 12:57

    Even more concisely, one can do:

      SELECT 
        n.nspname AS schema_name
       FROM pg_namespace n
      WHERE  has_schema_privilege('my_user',n.nspname, 'CREATE, USAGE');
    

提交回复
热议问题