Re: regarding grant option

Lists: pgsql-generalpgsql-sql
From: "AKHILESH GUPTA" <akhilesh(dot)davim(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: regarding grant option
Date: 2006-03-01 04:20:24
Message-ID: ad39daf90602282020q7a65b072l20a119788dbe2db7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

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"


From: Michael Fuhr <mike(at)fuhr(dot)org>
To: AKHILESH GUPTA <akhilesh(dot)davim(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: regarding grant option
Date: 2006-03-01 05:19:57
Message-ID: 20060301051957.GA16661@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

On Wed, Mar 01, 2006 at 09:50:24AM +0530, AKHILESH GUPTA wrote:
> 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.

Can the user connect to the database at all? Is she getting an
error message? If so, what's the error and at what point in the
connection is she getting it? What did she do immediately prior
to getting the error? Do the server logs contain any error messages?
If so, what are they?

If the user can't even connect then the problem is likely with
pg_hba.conf. See "Client Authentication" in the documentation for
more information:

http://www.postgresql.org/docs/8.0/interactive/client-authentication.html

--
Michael Fuhr


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: AKHILESH GUPTA <akhilesh(dot)davim(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] regarding grant option
Date: 2006-03-01 13:49:02
Message-ID: 20060301134902.GB4800@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

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


From: "AKHILESH GUPTA" <akhilesh(dot)davim(at)gmail(dot)com>
To: "AKHILESH GUPTA" <akhilesh(dot)davim(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] regarding grant option
Date: 2006-03-01 14:28:04
Message-ID: ad39daf90603010628q5e303d83g4cf419606d8fa726@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

thank you very much sir for your valuable suggestion,
but i am talking about direct database query...........!

On 3/1/06, Alvaro Herrera <alvherre(at)commandprompt(dot)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"


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: AKHILESH GUPTA <akhilesh(dot)davim(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] regarding grant option
Date: 2006-03-01 15:00:16
Message-ID: 20060301150016.GA6350@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

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(at)commandprompt(dot)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.


From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: AKHILESH GUPTA <akhilesh(dot)davim(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] regarding grant option
Date: 2006-03-01 22:12:33
Message-ID: 20060301221233.GV82012@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

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(at)commandprompt(dot)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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461