pg_restore ERROR

Поиск
Список
Период
Сортировка
От George Wilk
Тема pg_restore ERROR
Дата
Msg-id 024301c7d9eb$b3b5b340$1f7ca8c0@ellacoya.com
обсуждение исходный текст
Список pgsql-admin

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

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Tena Sakai"
Дата:
Сообщение: Re: postgres authentication
Следующее
От: Chris Browne
Дата:
Сообщение: Re: use replication on a database only on selected schemes?