Listing privileges on a schema

From: David Salisbury <salisbury(at)globe(dot)gov>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Listing privileges on a schema
Date: 2013-08-16 17:27:26
Message-ID: 520E60FE.1030509@globe.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

Is there a query out there where I can get a list of permissions associated to a schema?
Something like the below query that I can do for a table, but for a schema instead?

SELECT grantee, privilege_type
FROM information_schema.role_table_grants

WHERE table_name='sites' order by grantee, privilege_type;

I'm not seeing anything on the net or anything useful in information_schema like a
'role_schema_grants' view, and it doesn't appear I can do a \dp on a schema.
Nor the query psql uses for \dp on a table doesn't seem to have a nice way to
convert it to a schema permissions list. The secret is escaping me. :(

-ds

Background: -----------------

In pg_log, I'm seeing an error I'd like to clean up.

2013-08-15 13:00:32 GMT ERROR: permission denied for schema public at character 98
2013-08-15 13:00:32 GMT STATEMENT: select s.id, s.name, s.activate_at, s.old_sitecode, s.latitude, s.longitude, s.elevation from
public.site s where new_schoolid = $1

I get this error on a development system that is a spin off of a production system. The production system doesn't ever produce this
error. Doing a \dp between production and development the sites table shows no difference. I'd like to do the same for the public
schema. The public schema by default is open to all imho, and by explicitly opening it up ( to who I don't know) I may be just
removing a symptom.. but not the real problem.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2013-08-16 17:41:47 Re: Listing privileges on a schema
Previous Message Andrew Berman 2013-08-16 17:24:01 Re: Streaming Replication Randomly Locking Up