Skip site navigation (1) Skip section navigation (2)

BUG #4127: pg_dumpall -c unable to be restored without error

From: "Jacob Champlin" <jacobc(at)rentec(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4127: pg_dumpall -c unable to be restored without error
Date: 2008-04-24 16:37:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4127
Logged by:          Jacob Champlin
Email address:      jacobc(at)rentec(dot)com
PostgreSQL version: 8.1.11
Operating system:   SuSE 10.1
Description:        pg_dumpall -c unable to be restored without error

In 8.0  I would do a pg_dumpall -c  to backup my database.

In 8.1 you guys have added functionality to the -c flag to make it now DROP
and Recreate Roles.  Nice feature and seems to be the right thing to do.

However, with the DROP Roles in the file this causes the file to not be able
to be restored.

psql -f restore.sql

results in:

psql:/var/lib/pgsql/backups/restore.sql:11: ERROR:  current user cannot be
psql:/var/lib/pgsql/backups/restore.sql:12: ERROR:  role "postgres" already
psql:/var/lib/pgsql/backups/restore.sql:17: ERROR:  role "webapp" cannot be
dropped because some objects depend on it
DETAIL:  access to database rief
113 objects in database rief
psql:/var/lib/pgsql/backups/restore.sql:18: ERROR:  role "webapp" already


pgsql-bugs by date

Next:From: Tom LaneDate: 2008-04-24 16:44:14
Subject: Re: BUG #4127: pg_dumpall -c unable to be restored without error
Previous:From: spol@mail.ruDate: 2008-04-24 11:19:42
Subject: Re: HELP pls

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group