Full access to a DB with a second user? - Mailing list pgsql-sql

From Erik Wasser
Subject Full access to a DB with a second user?
Date
Msg-id 200409051453.57182.erik.wasser@iquer.net
Whole thread Raw
Responses Re: Full access to a DB with a second user?  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-sql
Hello pgsql-sql@postgresql.org,

how can I gave a user full access (SELECT, INSERT,...) to a database 
that he doesn't own? I used google to find a solution and I find a 
Statement[1] that will the do the trick. But it looks very cryptical to 
me. B-) What does this statement do?

> \a
> \t
> \o /tmp/grant.sql
> SELECT      'GRANT ALL ON ' || n.nspname || '.' || c.relname ||
>          ' TO joe;'
> FROM      pg_catalog.pg_class AS c
>          LEFT JOIN pg_catalog.pg_namespace AS n
>               ON n.oid = c.relnamespace
> WHERE     c.relkind IN ('r','v','S') AND
>          n.nspname NOT IN ('pg_catalog', 'pg_toast') AND
>          pg_catalog.pg_table_is_visible(c.oid)
> ORDER BY  n.nspname, c.relname;
> \o
> \i /tmp/grant.sql

Any hint is welcome. B-)

[1]http://www.mail-archive.com/pgsql-admin@postgresql.org/msg14416.html

-- 
So long... Fuzz


pgsql-sql by date:

Previous
From: Jeff Boes
Date:
Subject: Re: Complicated "group by" question
Next
From: "Daniel M."
Date:
Subject: Storing properties in a logical way.