X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CDCD4D1B4C9 for ; Mon, 26 Jul 2004 16:28:11 -0300 (ADT) 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 70052-02 for ; Mon, 26 Jul 2004 19:28:02 +0000 (GMT) Received: from simmts6-srv.bellnexxia.net (simmts6.bellnexxia.net [206.47.199.164]) by svr1.postgresql.org (Postfix) with ESMTP id C3787D1B74F for ; Mon, 26 Jul 2004 16:27:52 -0300 (ADT) Received: from localhost ([67.71.24.121]) by simmts6-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20040726192739.OEPB10364.simmts6-srv.bellnexxia.net@localhost>; Mon, 26 Jul 2004 15:27:39 -0400 Received: from sympatico.ca ([192.168.250.6]) by (8.11.6/8.11.6) with ESMTP id i6QJRmg20591; Mon, 26 Jul 2004 15:27:48 -0400 Message-ID: <41055B7D.7000106@sympatico.ca> Date: Mon, 26 Jul 2004 15:29:01 -0400 From: Jean-Luc Lachance User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en, en-us, en-gb, fr, fr-ca MIME-Version: 1.0 To: Randall Perry Cc: olly@lfix.co.uk, pgsql-admin@postgresql.org Subject: Re: How do I grant access to entire database at References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: 200407/297 X-Sequence-Number: 14365 I have been thinking about this problem for quite a while. Proper administration require creation of groups. Adding a new user to a database is as simple as adding the user to the group that has the required privileges to the database. But, I think one new command would be very usefull. CREATE GROUP FROM USER where the privileges would be derived from the user's. What do you think syntax gurus? Randall Perry wrote: > Thanks, I'll use it. > > But, if the developer's are listening -- this is really obtuse. MySQL > administration is much easier. Please consider simplifying the GRANT process > for future revs. > > BTW, I prefer postgresql for all my own development. > > > on 7/18/04 4:41 PM, Oliver Elphick at olly@lfix.co.uk wrote: > > >>On Sun, 2004-07-18 at 20:52, Randall Perry wrote: >> >>>This is a pain. Couldn't we gave something simple like >>>GRANT ALL ON database.* TO JOE; >>> >>>Which would grant full access to all objects in the database to JOE for all >>>time? >> >>You can do it like this in psql: >> >>\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 >> >> >>The above could be put in a script and run from a Unix command prompt. >> >>(The SQL used above is adaated from that used by psql's \d command.) > >