From: Alvaro Herrera <alvherre@commandprompt.com>
To: Julie Warden <Julie_Warden@nospam.hotmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_dump and roles
Date: Fri, 3 Oct 2008 13:35:50 -0400
Message-ID: <20081003173550.GE3817@alvh.no-ip.org> (raw)
In-Reply-To: <4k6ce45tvg8aqhnol6s8n6s3sn41bdc7q1@4ax.com>
References: <4k6ce45tvg8aqhnol6s8n6s3sn41bdc7q1@4ax.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: alvherre@commandprompt.com, Julie_Warden@nospam.hotmail.com
Subject: Re: pg_dump and roles
In-Reply-To: <20081003173550.GE3817@alvh.no-ip.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox