Backup roles / users

Started by Alain Rogerover 19 years ago3 messagesgeneral
Jump to latest
#1Alain Roger
raf.news@gmail.com

Hi,

I've checked in pg_dump and i did not find anything regarding backuping
roles ?

When i migrate my DB to another computer, should i recreate all roles
manually ?

thx.

Alain

#2Noname
Matthias.Pitzl@izb.de
In reply to: Alain Roger (#1)
Re: Backup roles / users

Hi Alain!

To get all the users and so on to the other machine, you have to use the
pg_dumpall tool with the -g switch. This will dump out all the users, groups
and roles i think.

-- Matthias

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Alain Roger
Sent: Friday, September 22, 2006 9:20 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Backup roles / users

Hi,

I've checked in pg_dump and i did not find anything regarding backuping
roles ?

When i migrate my DB to another computer, should i recreate all roles
manually ?

thx.

Alain

#3Vick Khera
vivek@khera.org
In reply to: Alain Roger (#1)
Re: Backup roles / users

On Sep 22, 2006, at 3:20 AM, Alain Roger wrote:

When i migrate my DB to another computer, should i recreate all
roles manually ?

either that or use this command to dump the roles as an SQL file you
can feed into the new server. it will complain about trying to
recreate the superuser, but that's ignorable:

pg_dumpall --globals-only -U ${pguser} > users.sql

where pguser is defined as the postgres superuser you use.

Attachments:

smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload