From: "pgsql-sql" <pgsql-sql(at)fc(dot)emc(dot)com(dot)ph>
To: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject:
Date: 2001-03-14 13:10:19
Message-ID: fc.000f567200a439d9000f567200a439d9.a43a08@fc.emc.com.ph
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice pgsql-sql

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(at)astrofoto(dot)org writes:
>>>>>> "bk" == Boulat Khakimov <boulat(at)inet-interactif(dot)com> 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
>--
>

Browse pgsql-general by date

  From Date Subject
Next Message Daniel A. Melo 2001-03-14 13:37:10 compilation error <segunda parte>
Previous Message Torsten Krmer 2001-03-14 11:49:51 Binary Large Data on Postgres

Browse pgsql-novice by date

  From Date Subject
Next Message Daniel A. Melo 2001-03-14 13:37:10 compilation error <segunda parte>
Previous Message Thomas Heinis 2001-03-14 12:46:18 Memory exhausted in AllocSetAlloc()

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-03-14 14:49:51 Re: my pgsql error?
Previous Message D'Arcy J.M. Cain 2001-03-14 13:02:28 Re: copy a record from one table to another (archive)