pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mauri Sahlberg <Mauri.Sahlberg@claymountain.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Backing up users?
Date: Sat, 30 Apr 2005 12:27:36 -0400
Message-ID: <2081.1114878456@sss.pgh.pa.us> (raw)
In-Reply-To: <42733EFB.2010908@claymountain.com>
References: <42733EFB.2010908@claymountain.com>

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



view thread (3+ messages)

Message-ID: <2081.1114878456@sss.pgh.pa.us>
Permalink:  ../2081.1114878456@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2081.1114878456@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Mauri.Sahlberg@claymountain.com
  Subject: Re: Backing up users?
  In-Reply-To: <2081.1114878456@sss.pgh.pa.us>
  References: <42733EFB.2010908@claymountain.com> <2081.1114878456@sss.pgh.pa.us>

* 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