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/

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to