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

Поиск
Список
Период
Сортировка
От Joe Kramer
Тема Best practice to grant all privileges on all bjects in database?
Дата
Msg-id b4c00a110605190519i3137cf94jb6006062ad2ed3e5@mail.gmail.com
обсуждение исходный текст
Ответы Re: Best practice to grant all privileges on all bjects in database?  ("John DeSoi" <desoi@pgedit.com>)
Список pgsql-general
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?

Thanks.

В списке pgsql-general по дате отправления:

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: RES: Add column and specify the column position in
Следующее
От: Robert Treat
Дата:
Сообщение: Re: Contributing code