Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0253564FD9E for ; Wed, 10 Dec 2008 07:46:08 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 11065-01 for ; Wed, 10 Dec 2008 07:46:04 -0400 (AST) X-Greylist: delayed 00:10:53.880859 by SQLgrey-1.7.6 Received: from mail-out2.uio.no (mail-out2.uio.no [129.240.10.58]) by mail.postgresql.org (Postfix) with ESMTP id 5D30B64FCD7 for ; Wed, 10 Dec 2008 07:46:04 -0400 (AST) Received: from mail-mx5.uio.no ([129.240.10.46]) by mail-out2.uio.no with esmtp (Exim 4.69) (envelope-from ) id 1LANLQ-0001YH-2r; Wed, 10 Dec 2008 12:35:08 +0100 Received: from inhaca.uio.no ([129.240.6.208]) by mail-mx5.uio.no with esmtp (Exim 4.69) (envelope-from ) id 1LANLP-0000HM-Ld; Wed, 10 Dec 2008 12:35:07 +0100 Message-ID: <493FA97B.90201@usit.uio.no> Date: Wed, 10 Dec 2008 12:35:23 +0100 From: Tommy Gildseth User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: Chris Curvey CC: pgsql-admin@postgresql.org Subject: Re: moving users/roles from one server to another? References: <18c933b9-afe9-48af-849c-50eb6d3f87d8@c36g2000prc.googlegroups.com> In-Reply-To: <18c933b9-afe9-48af-849c-50eb6d3f87d8@c36g2000prc.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-UiO-Spam-info: not spam, SpamAssassin (score=-5.0, required=5.0, autolearn=disabled, UIO_MAIL_IS_INTERNAL=-5, uiobl=NO, uiouri=NO) X-UiO-Scanned: C398903705D4680A2CF1FD50E17D526CB74B1D86 X-UiO-SPAM-Test: remote_host: 129.240.6.208 spam_score: -49 maxlevel 200 minaction 2 bait 0 mail/h: 1 total 182 max/h 3 blacklist 0 greylist 0 ratelimit 0 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: 200812/92 X-Sequence-Number: 30925 Chris Curvey wrote: > I'm a newbie to PG administration (although I have experience with > other DBs). I need to move a single database to a brand new server. > > I've set up the new server with initdb, set up pg_hba.conf and > postgresql.conf, and I can use dump and restore to move the database > to the new environment. > > What I can't figure out is how to move all the existing users and > roles over. I know about pg_dumpall, but that seems to be overkill -- > I don't need to move *all* the databases on my original server, just > one of them. > > Is there a way to copy over just the users (with their passwords) and > the roles? > > pg_dumpall -g If need be, you can edit the resulting SQL to only move over the bits you need. -- Tommy Gildseth DBA, Gruppe for databasedrift Universitetet i Oslo, USIT m: +47 45 86 38 50 t: +47 22 85 29 39