Обсуждение: regarding grant option

Поиск
Список
Период
Сортировка

regarding grant option

От
"AKHILESH GUPTA"
Дата:
hi all....
this is akhilesh from india.i just want to ask one thing regarding grant operation??
i am using pgsql 8.0 on ubuntu 5.10 linux.
just tell me the procedure that how can i grant all permissions for a database to any of the other user???
i am using :-
:->> grant all privileges on database <db_name> to <user_name>;
GRANT
:->> grant all ON DATABASE <db_name> to <user_name>;
GRANT

and the query executes succesfully.
but at the other user end, she is not able to access the database given in the above query.
here i have to grant permissions to that user individually for each and every table by using:
:->> grant ALL ON <tab_name> to <user_name>;
GRANT

and all the permissions are granted to that user for that particular table.

i want same results for the entire database.................
plz help me it's urgent

--
Thanks & Regards,
Akhilesh
DAV Institute of Management
Faridabad(Haryana)
GSM:-(+919891606064)
          (+911744293789)

"FAILURES CAN BE FORGIVEN BUT AIMING LOW IS A CRIME"

Re: regarding grant option

От
Alvaro Herrera
Дата:
AKHILESH GUPTA wrote:

> here i have to grant permissions to that user individually for each and
> every table by using:
> :->> grant ALL ON <tab_name> to <user_name>;
> GRANT
> and all the permissions are granted to that user for that particular table.

Yes.  If you are annoyed by having to type too many commands, you can
write a little shell script to do it for you.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: regarding grant option

От
"AKHILESH GUPTA"
Дата:
thank you very much sir for your valuable suggestion,
but i am talking about direct database query...........!

On 3/1/06, Alvaro Herrera < alvherre@commandprompt.com> wrote:
AKHILESH GUPTA wrote:

> here i have to grant permissions to that user individually for each and
> every table by using:
> :->> grant ALL ON <tab_name> to <user_name>;
> GRANT
> and all the permissions are granted to that user for that particular table.

Yes.  If you are annoyed by having to type too many commands, you can
write a little shell script to do it for you.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



--
Thanks & Regards,
Akhilesh
DAV Institute of Management
Faridabad(Haryana)
GSM:-(+919891606064)
          (+911744293789)

"FAILURES CAN BE FORGIVEN BUT AIMING LOW IS A CRIME"

Re: regarding grant option

От
Alvaro Herrera
Дата:
AKHILESH GUPTA wrote:
> thank you very much sir for your valuable suggestion,
> but i am talking about direct database query...........!

There is none that can help you here, short of making a function in
PL/pgSQL or other language ...

> On 3/1/06, Alvaro Herrera <alvherre@commandprompt.com> wrote:
> >
> > AKHILESH GUPTA wrote:
> >
> > > here i have to grant permissions to that user individually for each and
> > > every table by using:
> > > :->> grant ALL ON <tab_name> to <user_name>;
> > > GRANT
> > > and all the permissions are granted to that user for that particular
> > table.
> >
> > Yes.  If you are annoyed by having to type too many commands, you can
> > write a little shell script to do it for you.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: regarding grant option

От
"Jim C. Nasby"
Дата:
Though, it is pretty easy to do something like:

select 'GRANT ALL ON ' || table_name || ' TO public;' from
information_schema.tables where table_schema='blah';

You can feed the output of that to psql, ei:

psql -qc "select 'GRANT ALL ON ' || table_name || ' TO public;' from
information_schema.tables where table_schema='blah'" | psql

On Wed, Mar 01, 2006 at 12:00:16PM -0300, Alvaro Herrera wrote:
> AKHILESH GUPTA wrote:
> > thank you very much sir for your valuable suggestion,
> > but i am talking about direct database query...........!
>
> There is none that can help you here, short of making a function in
> PL/pgSQL or other language ...
>
> > On 3/1/06, Alvaro Herrera <alvherre@commandprompt.com> wrote:
> > >
> > > AKHILESH GUPTA wrote:
> > >
> > > > here i have to grant permissions to that user individually for each and
> > > > every table by using:
> > > > :->> grant ALL ON <tab_name> to <user_name>;
> > > > GRANT
> > > > and all the permissions are granted to that user for that particular
> > > table.
> > >
> > > Yes.  If you are annoyed by having to type too many commands, you can
> > > write a little shell script to do it for you.
>
> --
> Alvaro Herrera                                http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>

--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461