Re: pg_dump and roles

From: "Peter Steinheuser" <peter(dot)steinheuser(at)enterprisedb(dot)com>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_dump and roles
Date: 2008-10-03 17:44:13
Message-ID: c30da9e30810031044o3f11021ar5dec933fbf2d51e8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

use pg_dumpall -g

On Fri, Oct 3, 2008 at 1:35 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com>wrote:

> 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
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

--
Peter Steinheuser
EnterpriseDB Corporation
499 Thornall Street
2nd Floor
Edison, NJ 08837
+1.732.331.1378 Office
+1.908.419.4220 Cell
+1.732.331.1301 Fax
peter(dot)steinheuser(at)enterprisedb(dot)com

http://www.enterprisedb.com
Built on open source. Compatible with Oracle(R).

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Yauheni Labko 2008-10-03 20:12:13 Re: pg_dump and roles
Previous Message Alvaro Herrera 2008-10-03 17:35:50 Re: pg_dump and roles