Re: Does a user have usage on a schema?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Walker, Jed S" <Jed_Walker(at)cable(dot)comcast(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Does a user have usage on a schema?
Date: 2005-06-29 16:09:18
Message-ID: 20050629160918.GA9097@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Jun 29, 2005 at 09:59:06 -0600,
"Walker, Jed S" <Jed_Walker(at)cable(dot)comcast(dot)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)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Vincenzo Romano 2005-06-29 20:59:10 Re: Rule creation and evaluation order
Previous Message Walker, Jed S 2005-06-29 15:59:06 Re: Does a user have usage on a schema?