Re: Backing up users? - Mailing list pgsql-admin

From Tom Lane
Subject Re: Backing up users?
Date
Msg-id 2081.1114878456@sss.pgh.pa.us
Whole thread Raw
In response to Backing up users?  (Mauri Sahlberg <Mauri.Sahlberg@claymountain.com>)
List pgsql-admin
Mauri Sahlberg <Mauri.Sahlberg@claymountain.com> writes:
> What if I just wish to move a single database with it's users to a new
> machine? It would be a disaster to overwrite whole existing system
> catalog on the target machine.

Users (and groups) are global across each Postgres installation.
So what you'd need to do is something like this:

pg_dump the desired database, and do "pg_dumpall -g" to get a script
recreating all your users and groups.  Edit out the non-pertinent
part of that script.  Run the users/groups script and then the pg_dump
script on the target machine.

            regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Unable to drop index
Next
From: Enrico Weigelt
Date:
Subject: Re: Suse 9.2 stops booting while starting the postgres-server