Re: CREATE DATABASE fails when template1 being accessed ...

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: CREATE DATABASE fails when template1 being accessed ...
Дата
Msg-id 20050531190834.GB9073@surnet.cl
обсуждение исходный текст
Ответ на CREATE DATABASE fails when template1 being accessed ...  ("Marc G. Fournier" <scrappy@postgresql.org>)
Список pgsql-hackers
On Tue, May 31, 2005 at 02:53:41PM -0300, Marc G. Fournier wrote:

> ERROR:  source database "template1" is being accessed by other users
> 
> Why is this not allowed?  Not that there is generally a reason to be in 
> template1, but am curious as to why it prevents a new DB from being 
> created if someone is connected to it ...

Because we copy the files directly.  So if someone modifies one file in
the middle of the copy, or, say, we copy one index and later the table
and someone inserts into a table in the middle, then the new database is
in an inconsistent state.

There has been talk about fixing this in the past, but conclusion seems
to be "too hard to fix for too little benefit."

-- 
Alvaro Herrera (<alvherre[a]surnet.cl>)
"No hay hombre que no aspire a la plenitud, es decir,
la suma de experiencias de que un hombre es capaz"


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: CREATE DATABASE fails when template1 being accessed ...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Deadlock with tsearch2 index ...