Re: roles

From: salah jubeh <s_jubeh(at)yahoo(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: roles
Date: 2011-07-01 12:06:49
Message-ID: 1309522009.86665.YahooMailRC@web161514.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have two databases, I need to insure that both databases has the same roles.
tables, schemas, views must have the same permissions and privileges. you can
say and Identical clones. I can synchronize the roles using these statements

SELECT DISTINCT 'CREATE USER '||usename||';' FROM pg_user;
SELECT 'GRANT '||g.usename||' TO '||u.usename||';' FROM pg_auth_members a JOIN
pg_user u ON a.member = u.usesysid JOIN pg_user g ON a.roleid = g.usesysid;
SELECT 'ALTER ROLE '||usename||' WITH SUPERUSER;' FROM pg_user WHERE usesuper;

However, How can I synchronize the privileges that are assigned to the
database entities i.e. schemas , tables, and views.

If that solution is not possible, how can I create an identical clone of my
database including roles. when I use pg_restore normally the owner of the tables
are changed and you need to recreate the roles in advance

Regards

In response to

  • roles at 2011-07-01 12:00:06 from salah jubeh

Responses

  • Re: roles at 2011-07-01 12:39:13 from Rob Richardson
  • Re: roles at 2011-07-01 12:49:35 from Chris Travers

Browse pgsql-general by date

  From Date Subject
Next Message Rob Richardson 2011-07-01 12:39:13 Re: roles
Previous Message salah jubeh 2011-07-01 12:00:06 roles