Full access to a DB with a second user?

From: Erik Wasser <erik(dot)wasser(at)iquer(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Full access to a DB with a second user?
Date: 2004-09-05 12:53:57
Message-ID: 200409051453.57182.erik.wasser@iquer.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello pgsql-sql(at)postgresql(dot)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(at)postgresql(dot)org/msg14416.html

--
So long... Fuzz

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Pierre-Frédéric Caillaud 2004-09-05 17:51:44 Re: Storing properties in a logical way.
Previous Message James M Doherty 2004-09-03 14:36:44 HOW TO HANDLE ZEROS IN DATE FIELD?