> -----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