Re: role missing in dump - Mailing list pgsql-general

From Adrian Klaver
Subject Re: role missing in dump
Date
Msg-id 201203021514.18388.adrian.klaver@gmail.com
Whole thread Raw
In response to role missing in dump  (Thomas Prause <tprause@imail.de>)
List pgsql-general
On Friday, March 02, 2012 2:39:22 pm Thomas Prause wrote:
> Hi,
> when upgrading from 8.4 to 9.1 (Ubuntu 10.10 to 11.10) I did face some
> problems (probably due to a non standard data directory. But I don't
> care about that. Finally I decided to use the dump to recreate this very
> small database.
>
> When starting the application that uses the db I realized that a role
> (the only one I have created) was missing. Is this some bug in 8.4 that
> roles are not included in the dump or did I miss something?

Roles are global to a cluster. If you do a pg_dump you will get only the
information/data for a particular database. If you do pg_dumpall you will get
the information/data for all the databases in the cluster as well as the cluster
wide information. A compromise solution is to pg_dump a particular database and
then do pg_dumpall -g which dumps only the global information. See here for more
info:

http://www.postgresql.org/docs/9.0/interactive/app-pg-dumpall.html
http://www.postgresql.org/docs/9.0/interactive/app-pgdump.html

>
> Regards,
> Thomas

--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Thomas Prause
Date:
Subject: role missing in dump
Next
From: Adrian Klaver
Date:
Subject: Re: Restoring selected records from backup file