pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: George Wilk <gwilk@ellacoya.com>
To: pgsql-admin@postgresql.org
Subject: pg_restore ERROR
Date: Wed, 8 Aug 2007 14:41:15 -0400
Message-ID: <024301c7d9eb$b3b5b340$1f7ca8c0@ellacoya.com> (raw)

After running pg_dumpall on my database cluster like this:

 

$PGBIN/pg_dumpall -c -U ipscdb | gzip > /var/db/pgsql_bkp/pg_dump_file.gz

 

I subsequently delete the PGDATA directory for the backed up database and
initialize a new database.  Next I attempt to run the restore using
initialized database like this:

 

cat /var/db/pgsql_bkp/pg_dump_file.gz | gunzip | $PGBIN/psql postgres >
/dev/null

 

This results in a couple of error messages:

 

ERROR:  current user cannot be dropped

ERROR:  role "ipscdb" already exists

 

Since I ran initdb to initialize my database after the pg_dumpall as
"ipscdb" user, and subsequently am running the restore as "ipscdb" user, it
does make sense that I see these errors.  The first one is caused by the -c
switch on pg_dumpall which generates the script to drop all database objects
before restore is done.  The second is a consequence of the first one -
script is attempting to create a role, which already exists.

 

My questions are:

1)       What would be the right way to do this?  (other than pg_restore
with the create option)

2)       Does the restore go forward despite the two errors shown above -
meaning that I can pretty much ignore these errors?

 

Thanks in advance,

~george

view thread (26+ messages)  latest in thread

Message-ID: <024301c7d9eb$b3b5b340$1f7ca8c0@ellacoya.com>
Permalink:  ../024301c7d9eb$b3b5b340$1f7ca8c0@ellacoya.com/
Also on:    postgresql.org/message-id/024301c7d9eb$b3b5b340$1f7ca8c0@ellacoya.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gwilk@ellacoya.com
  Subject: Re: pg_restore ERROR
  In-Reply-To: <024301c7d9eb$b3b5b340$1f7ca8c0@ellacoya.com>

* 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