| From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> | 
|---|---|
| To: | Julie Warden <Julie_Warden(at)nospam(dot)hotmail(dot)com> | 
| Cc: | pgsql-admin(at)postgresql(dot)org | 
| Subject: | Re: pg_dump and roles | 
| Date: | 2008-10-03 17:35:50 | 
| Message-ID: | 20081003173550.GE3817@alvh.no-ip.org | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-admin | 
Julie Warden wrote:
> Is there a method to dump just the roles from a database, or otherwise
> select them, so I can build a script to reload the roles? Otherwise, I
> guess I'll just read the tables for each database and build the
> security script from that.
Roles are not per-database; they are global objects.  You can get a dump
of all the roles with pg_dumpall -g.
If you really need to filter out roles per database, my best suggestion
is to filter a global role dump them with the pg_shdepend catalog for
each database.
-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Steinheuser | 2008-10-03 17:44:13 | Re: pg_dump and roles | 
| Previous Message | Julie Warden | 2008-10-03 13:21:46 | pg_dump and roles |