Re: Best practice to grant all privileges on all bjects in database?

From: "John DeSoi" <desoi(at)pgedit(dot)com>
To: "Joe Kramer" <cckramer(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Best practice to grant all privileges on all bjects in database?
Date: 2006-05-20 19:51:25
Message-ID: e2828ab30605201251v1a7805feq256f1a5b7c5fed58@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You can find some helpful grant scripts here:

http://pgedit.com/tip/postgresql/access_control_functions

On 5/19/06, Joe Kramer <cckramer(at)gmail(dot)com> wrote:
>
> Hello,
>
> I need to grant all privileges on all objects in database. Without
> using SUPERUSER.
>
> It's strange that GRANT ALL PRIVILEGES ON DATABASE is useless, it
> don't grant privileges on tables.
>
> I've found out this "best practice", (more like ugly workaround):
>
> select 'grant all on '||schemaname||'.'||tablename||' to
> \\\"$USER\\\";' from pg_tables where schemaname in ('public');
> select 'grant all on '||schemaname||'.'||viewname||' to
> \\\"$USER\\\";' from pg_views where schemaname in ('public');
>
> and same for functions,sequences etc.
>
>
> Is there nicer, more friendly way? Maybe there is something like
> contrib module or procedure that does that in user-friendly way?
>
> If not, anyone has a better version of above grant script?
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2006-05-20 20:28:28 Re: No stddev() for interval?
Previous Message Bruno Wolff III 2006-05-20 19:33:23 Re: Let's make CPgAN!