Skip site navigation (1) Skip section navigation (2)

Re: Does a user have usage on a schema?

From: "Walker, Jed S" <Jed_Walker(at)cable(dot)comcast(dot)com>
To: "Bruno Wolff III" <bruno(at)wolff(dot)to>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Does a user have usage on a schema?
Date: 2005-06-29 15:59:06
Message-ID: 4A59B6AA01F1874283EA66C976ED51FC46611A@COENGEXCMB01.cable.comcast.com (view raw or flat)
Thread:
Lists: pgsql-novice
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);

I'd like to get a listing of rows such as

Schema1
Schema2
schema7

But that (and some other similar attempts) aren't working. How can I do
this?

Thanks again,

Jed. 

-----Original Message-----
From: Bruno Wolff III [mailto:bruno(at)wolff(dot)to] 
Sent: Wednesday, June 29, 2005 9:37 AM
To: Walker, Jed S
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Does a user have usage on a schema?

On Wed, Jun 29, 2005 at 08:57:32 -0600,
  "Walker, Jed S" <Jed_Walker(at)cable(dot)comcast(dot)com> wrote:
> How can I query the database to determine if a user has usage on a 
> particular schema, and how can I query the database to find out all 
> the schemas a user has usage on?

The has_schema_privilege function will allow you to check if a user has
access to a schema. You can use pg_users to get a list of all users and
pg_namespace can be used to get a list of all schemas.

Responses

pgsql-novice by date

Next:From: Bruno Wolff IIIDate: 2005-06-29 16:09:18
Subject: Re: Does a user have usage on a schema?
Previous:From: Bruno Wolff IIIDate: 2005-06-29 15:36:35
Subject: Re: Does a user have usage on a schema?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group