X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8508B5E48FF for ; Sun, 5 Sep 2004 17:53:12 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07264-09 for ; Sun, 5 Sep 2004 16:53:07 +0000 (GMT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by svr1.postgresql.org (Postfix) with ESMTP id AAC795E49D4 for ; Sun, 5 Sep 2004 17:52:11 +0100 (BST) Received: from sv0.iquer.net (sv0.iquer.net [195.234.230.122]) by svr4.postgresql.org (Postfix) with SMTP id 6A9DB5AF41F for ; Sun, 5 Sep 2004 12:55:21 +0000 (GMT) Received: (qmail 18119 invoked by uid 108); 5 Sep 2004 12:53:06 -0000 Received: from unknown (HELO fuzz.int.iquer.net) (10.0.17.20) by sv0.iquer.net with SMTP; 5 Sep 2004 12:53:06 -0000 From: Erik Wasser To: pgsql-sql@postgresql.org Subject: Full access to a DB with a second user? Date: Sun, 5 Sep 2004 14:53:57 +0200 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200409051453.57182.erik.wasser@iquer.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/30 X-Sequence-Number: 18876 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