Re: Granting privileges on all tables,sequences , views, procedures

From: Grzegorz Szpetkowski <gszpetkowski(at)gmail(dot)com>
To: Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Granting privileges on all tables,sequences , views, procedures
Date: 2011-05-17 12:19:58
Message-ID: BANLkTikcdf=ugFbBBWoXv_Tr4D9yiiYvRA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2011/5/17 Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>:
> Dear all,
>
> Today I grant a user all privileges to all tables in  a database by
>
> grant all privileges on   svo_data_social to neha ;              grant all
> privileges on   svo_phrases to neha ;
> .. . .....
> .....
> ...
>
> Now i find it very uncomfort   to grant privileges one by one table.
>
> Is there a simple way to grant privileges on all tables, views, sequences
> etc in a database.
>
> Also , after granting all privileges , rename command is not granted.
>
> Is it impossible to grant alter & drop privileges to user which is granted
> to only the user who created the object.
>
> What is ALL privileges comprised of ?
>
>
> Thanks
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

I think that you can grant membership in that role, so member role has
ability to run ALTER, DROP etc. on tables, which even doesn't own.

You can also change owner of object using ALTER TABLE for example
ALTER TABLE sometable OWNER TO new_owner, but probably previous owner
need to be granted as new_owner's member.

To grant privileges on all tables, I think you can write sql function,
which obtains list of all tables, schemas, views in database and fire
GRANT ALL for each of them.

Regards,
Grzegorz Szpetkowski

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bernardo Telles 2011-05-17 12:51:12 Re: How do we combine and return results from multiple queries in a loop?
Previous Message hubert depesz lubaczewski 2011-05-17 11:41:49 Re: each (hstore)