roles

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


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 synchronise the roles using these statments

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;

Responses

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

Browse pgsql-general by date

  From Date Subject
Next Message salah jubeh 2011-07-01 12:06:49 Re: roles
Previous Message Tomonari Katsumata 2011-07-01 09:39:22 Re: pg_rman in Windows - is it possible?