Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id E743F9FB851 for ; Wed, 8 Aug 2007 15:41:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 42078-04-3 for ; Wed, 8 Aug 2007 15:41:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail02.ellacoya.com (67-135-29-172.dia.static.qwest.net [67.135.29.172]) by postgresql.org (Postfix) with ESMTP id 120499FB7FB for ; Wed, 8 Aug 2007 15:41:19 -0300 (ADT) Received: from YZANGXP ([192.168.124.31]) by mail02.ellacoya.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 8 Aug 2007 14:41:18 -0400 From: "George Wilk" To: Subject: pg_restore ERROR Date: Wed, 8 Aug 2007 14:41:15 -0400 Message-ID: <024301c7d9eb$b3b5b340$1f7ca8c0@ellacoya.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0244_01C7D9CA.2CA41340" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Thread-Index: AcfZ67OKUTJ19I95SR2K+GijdpYa1w== X-OriginalArrivalTime: 08 Aug 2007 18:41:18.0777 (UTC) FILETIME=[B56DEA90:01C7D9EB] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-5.000.1021-15350.000 X-TM-AS-Result: No--12.357200-4.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/84 X-Sequence-Number: 26415 This is a multi-part message in MIME format. ------=_NextPart_000_0244_01C7D9CA.2CA41340 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_0244_01C7D9CA.2CA41340 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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

------=_NextPart_000_0244_01C7D9CA.2CA41340--