Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: pgsql-general-owner@xxxxxxxxxxxxxx [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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux