Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f2EF7sx22488 for ; Wed, 14 Mar 2001 10:07:54 -0500 (EST) (envelope-from pgsql-general-owner@postgresql.org) Received: from miranda.emc.com.ph ([210.23.230.194]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f2EDAPx08167; Wed, 14 Mar 2001 08:10:25 -0500 (EST) (envelope-from pgsql-sql@fc.emc.com.ph) Received: from fc.emc.com.ph (mnl.emc.com.ph [203.167.64.16]) by miranda.emc.com.ph (Postfix) with ESMTP id EC34A6B004; Wed, 14 Mar 2001 21:10:19 +0800 (PHT) Message-id: Date: Wed, 14 Mar 2001 21:10:19 +0800 Subject: To: pgsql-sql@postgresql.org, pgsql-general@postgresql.org, pgsql-novice@postgresql.org From: "pgsql-sql" MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200103/660 X-Sequence-Number: 6179 you can also do it by a shell script grantall.sh: ###### start of grantall.sh ####### #!/bin/ash SQL="SELECT relname FROM pg_class WHERE (relkind = 'r' OR relkind = 'S') AND relname !~ '^pg_' ORDER BY relname" OBJ=`psql -t -c "${SQL}" $1` # OBJ=`echo ${OBJ} | sed 's/EOF//g'` OBJ=`echo ${OBJ} | sed 's/ /, /g'` # SQL="REVOKE ALL ON ${OBJ} FROM PUBLIC" SQL="GRANT ALL ON ${OBJ} TO PUBLIC" echo ${SQL} psql -c "${SQL}" $1 ###### end of grantall.sh ####### syntax: grantall.sh name_of_database sherwin roland@astrofoto.org writes: >>>>>> "bk" == Boulat Khakimov writes: > > bk> How do I grant permissions on everything in the selected > bk> databes? > > bk> GRANT doesnt take as on object database name nor does it > bk> accept wild chars.... > >Attached is some Perl code I wrote long ago to do this. This >particular code was done for Keystone, a problem tracking database and >it would do a "GRANT ALL". Modify it as needed. Last I checked it >worked with both PostgreSQL 6.5.x and 7.0.x > > >roland >-- >