On Wed, Jun 29, 2005 at 09:59:06 -0600,
"Walker, Jed S" <Jed_Walker@cable.comcast.com> wrote:
> Thanks Bruno. I found the definitions for the has_schema_privilege and
> it appears it'll work.
>
> Also, how can I query against pg_namespace to find out what schemas a
> user has. I've tried something like
>
> Select * from pg_namespace where 'username' = any(nspacl);
You would do something like:
SELECT nspname
FROM pg_namespace
WHERE
has_schema_privilege('bruno', nspname, 'usage')
;
For example:
area=> select nspname from pg_namespace where has_schema_privilege(
area(> 'bruno', nspname, 'usage');
nspname
--------------------
pg_catalog
information_schema
public
(3 rows)