Skip site navigation (1) Skip section navigation (2)

Re: Backing up users?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mauri Sahlberg <Mauri(dot)Sahlberg(at)claymountain(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Backing up users?
Date: 2005-04-30 16:27:36
Message-ID: 2081.1114878456@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
Mauri Sahlberg <Mauri(dot)Sahlberg(at)claymountain(dot)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

In response to

pgsql-admin by date

Next:From: svDate: 2005-05-02 02:13:39
Subject: Getting Started Basic Admin
Previous:From: Tom LaneDate: 2005-04-30 16:19:30
Subject: Re: Unable to drop index

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group