dumping and restoring user information.

From: Pritesh Shah <pritesh(dot)krish(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: dumping and restoring user information.
Date: 2005-02-01 07:11:06
Message-ID: de6ea2a7050131231124c42c3c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi,

I'm trying to make some hardware upgrades (increasing disk capacity)
to the machine where the database server is running. So, I've backed
up all the existing databases using the following command:

pg_dump -f <location_for_dump> -Fc -v <dbname>

I want to restore these databases on a different machine. I've got the
postmaster installed and running (version same as on old one). To
restore the databases i tried the following command:

pg_restore -v -d <dbname> <dump_location>

to which i got the following error:

pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database "abc" failed: FATAL: datab
ase "abc" does not exist
pg_restore: *** aborted because of error

Realizing my mistake i used the following command:

pg_restore -v -C -d template1 <dump_location>

to which i got the following error:

pg_restore: connecting to database for restore
pg_restore: creating DATABASE abc
pg_restore: [archiver] could not set session user to "abc": ERROR:
user "abc" does not exist
pg_restore: *** aborted because of error

So, seeing this i first made the user, using 'createuser' and then
created a database using 'createdb'. Now, since i have many users do i
have to everytime createuser and createdb for each user and database.
Is there any way of copying/dumping/restoring the user and group
information and permissions from the old machine to the new one so
that i do not have to do a createuser everytime??

Could somebody help me out with this please. Thanks in advance.

Cheers,
Pritesh

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-02-01 07:30:31 Re: dumping and restoring user information.
Previous Message Tom Lane 2005-02-01 06:53:55 Re: cmin increments by 2 except in 7.4?