Re: Does a user have usage on a schema? - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: Does a user have usage on a schema?
Date
Msg-id 20050629160918.GA9097@wolff.to
Whole thread Raw
In response to Re: Does a user have usage on a schema?  ("Walker, Jed S" <Jed_Walker@cable.comcast.com>)
List pgsql-novice
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)

pgsql-novice by date:

Previous
From: "Walker, Jed S"
Date:
Subject: Re: Does a user have usage on a schema?
Next
From: Vincenzo Romano
Date:
Subject: Re: Rule creation and evaluation order