Re: create database from template requires the source database to be unused

Поиск
Список
Период
Сортировка
От Haszlakiewicz, Eric
Тема Re: create database from template requires the source database to be unused
Дата
Msg-id 4EB74494E20A13478F64930FDE244D6402673105@CHO3WUC9MBX11.corp.transunion.com
обсуждение исходный текст
Ответ на Re: create database from template requires the source database to be unused  (Craig Ringer <ringerc@ringerc.id.au>)
Ответы Re: create database from template requires the source database to be unused  (Alban Hertroys <haramrae@gmail.com>)
Список pgsql-general
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> It'd be really interesting to relax that limitation to "... other
> non-read-only transaction ... " and have a database that's being cloned
> block or reject
> DML, UPDATE, etc. There are some issues with that though:
> 
> (a) Transactions are read/write by default. Most apps don't bother to
> SET TRANSACTION READ ONLY or BEGIN READ ONLY TRANSACTION . Most
> non-read-only transactions will make no changes, but the database can't
> know that until they complete.
> 
> (b) AFAIK even truly read-only transactions can set hint bits and
> certain other system level database metadata.
> 
> (c) Because of (a) it'd be necessary to block your CREATE DATABASE ...
> TEMPLATE ... until all transactions finished and sessions were idle, or
> to abort all transactions and roll them back.

I've read that postgres uses MVCC for transactions, and that it creates 
snapshots of the database for each transaction.  Couldn't the create
database command just use that snapshot?

eric

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

Предыдущее
От: tuanhoanganh
Дата:
Сообщение: Postgresql 9.0.6 alway run VACUUM ANALYZE pg_catalog.pg_attribute
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: create database from template requires the source database to be unused