Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C6C9737BC87 for ; Fri, 3 Oct 2008 15:16:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 37142-02 for ; Fri, 3 Oct 2008 15:16:56 -0300 (ADT) X-Greylist: delayed 00:27:15.41338 by SQLgrey-1.7.6 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by postgresql.org (Postfix) with ESMTP id AC00037BAB4 for ; Fri, 3 Oct 2008 15:16:55 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 29so1564074ugo.7 for ; Fri, 03 Oct 2008 11:16:54 -0700 (PDT) Received: by 10.86.93.19 with SMTP id q19mr1483219fgb.76.1223055854043; Fri, 03 Oct 2008 10:44:14 -0700 (PDT) Received: by 10.86.2.17 with HTTP; Fri, 3 Oct 2008 10:44:13 -0700 (PDT) Message-ID: Date: Fri, 3 Oct 2008 13:44:13 -0400 From: "Peter Steinheuser" To: "Alvaro Herrera" Subject: Re: pg_dump and roles Cc: pgsql-admin@postgresql.org In-Reply-To: <20081003173550.GE3817@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10082_18140664.1223055854062" References: <4k6ce45tvg8aqhnol6s8n6s3sn41bdc7q1@4ax.com> <20081003173550.GE3817@alvh.no-ip.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200810/15 X-Sequence-Number: 30471 ------=_Part_10082_18140664.1223055854062 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline use pg_dumpall -g On Fri, Oct 3, 2008 at 1:35 PM, Alvaro Herrera 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@postgresql.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.steinheuser@enterprisedb.com http://www.enterprisedb.com Built on open source. Compatible with Oracle(R). ------=_Part_10082_18140664.1223055854062 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
use pg_dumpall -g

On Fri, Oct 3, 2008 at 1:35 PM, Alvaro Herrera <alvherre@commandprompt.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@postgresql.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.steinheuser@enterprisedb.com

http://www.enterprisedb.com
Built on open source. Compatible with Oracle®.

------=_Part_10082_18140664.1223055854062--