Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id ABB9C37BFD3 for ; Fri, 3 Oct 2008 14:35: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 28106-08 for ; Fri, 3 Oct 2008 14:35:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id 4303237BFF8 for ; Fri, 3 Oct 2008 14:35:55 -0300 (ADT) Received: from perhan.alvh.no-ip.org (200-126-104-145.bk7-dsl.surnet.cl [200.126.104.145]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m93HdbOl012203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Oct 2008 10:39:40 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 1709247CB5; Fri, 3 Oct 2008 13:35:50 -0400 (CLT) Date: Fri, 3 Oct 2008 13:35:50 -0400 From: Alvaro Herrera To: Julie Warden Cc: pgsql-admin@postgresql.org Subject: Re: pg_dump and roles Message-ID: <20081003173550.GE3817@alvh.no-ip.org> References: <4k6ce45tvg8aqhnol6s8n6s3sn41bdc7q1@4ax.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4k6ce45tvg8aqhnol6s8n6s3sn41bdc7q1@4ax.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Fri, 03 Oct 2008 10:39:40 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/14 X-Sequence-Number: 30470 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