Re: restore pg_dumpall problem with update 7.0.3 to 7.1.1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: restore pg_dumpall problem with update 7.0.3 to 7.1.1
Дата
Msg-id 13533.991071343@sss.pgh.pa.us
обсуждение исходный текст
Ответ на restore pg_dumpall problem with update 7.0.3 to 7.1.1  ("holtzman" <fill-in-the-blanks_@_._>)
Список pgsql-general
"holtzman" <fill-in-the-blanks_@_._> writes:
> [pg_dumpall script fails with]
>   psql:dump_file:11: ERROR:  CREATE DATABASE: source database "template1" is
> being accessed by other users

Hm.  There is a bit of a race condition here, perhaps --- the pg_dumpall
script does

    \connect template1 $DBOWNER
    CREATE DATABASE foo;

and in the case of the very first database in the dump, the \connect is
redundant: before the \connect we were connected to template1 already.
In that case the old backend might not have finished shutting down by
the time the CREATE is issued, leading to this complaint.

This problem won't arise in dumps made with 7.1 pg_dump since they
will refer to template0, not template1, as the source for the CREATE
DATABASE copy ... and there shouldn't ever be anyone connected to
template0.

Evidently there is a risk with 7.0 dump scripts being brought forward,
however.  Removing the redundant \connect command may do as a workaround
for them.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Simple SQL question, need help.
Следующее
От: "Dave Cramer"
Дата:
Сообщение: Re: Seq Scan