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

2012-06-28 Thread Tom Lane
Alban Hertroys writes: >> 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? > Database creation cannot be done inside a transaction (one of the few > DDL state

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

2012-06-28 Thread Alban Hertroys
> 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? Database creation cannot be done inside a transaction (one of the few DDL statements that can't), so no. --

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

2012-06-28 Thread Haszlakiewicz, Eric
> -Original Message- > From: pgsql-general-ow...@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 wi

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

2012-06-27 Thread Alban Hertroys
On 28 Jun 2012, at 5:11, Tim Uckun wrote: > I am sure this is intended behavior but it seems odd (and inconvenient) to me. > > create database tim_test_copy template tim_test > > ERROR: source database "tim_test" is being accessed by other users > DETAIL: There are 1 other session(s) using the

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

2012-06-27 Thread Craig Ringer
On 06/28/2012 11:11 AM, Tim Uckun wrote: I am sure this is intended behavior but it seems odd (and inconvenient) to me. create database tim_test_copy template tim_test ERROR: source database "tim_test" is being accessed by other users DETAIL: There are 1 other session(s) using the database.

[GENERAL] create database from template requires the source database to be unused

2012-06-27 Thread Tim Uckun
I am sure this is intended behavior but it seems odd (and inconvenient) to me. create database tim_test_copy template tim_test ERROR: source database "tim_test" is being accessed by other users DETAIL: There are 1 other session(s) using the database. I would presume only reads are required fro