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

Re: Allow GRANT/REVOKE permissions to be applied to all schema

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allow GRANT/REVOKE permissions to be applied to all schema
Date: 2005-02-01 16:30:53
Message-ID: 200502011730.54459.peter_e@gmx.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Josh Berkus wrote:
> > pg_find --type=table --schema=foo --name='system_*'
> > --execute='GRANT ALL ON % TO myuser'
>
> Hey, that's a way keen idea.   Regardless of what we do with
> GRANT/REVOKE. You don't happen to, uh, have any code for that?

psql -t -A -c "select tablename from pg_tables where schemaname = 'foo' 
and tablename like 'system_%';" | xargs -i -n 1 psql -c 'grant all on 
{} to myuser;'

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-02-01 16:54:55
Subject: Re: STABLE functions
Previous:From: Richard HuxtonDate: 2005-02-01 16:27:22
Subject: Re: Allow GRANT/REVOKE permissions to be applied to all

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