Re: Problem with "create database ... with template "

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problem with "create database ... with template "
Date: 2007-05-09 18:31:54
Message-ID: 29215.1178735514@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> writes:
> I'm investigating a problem my client experienced with
> "create database xxx with template=yyy" - they often get error
> "ERROR: source database "yyy" is being accessed by other users",

Your test case simply shows that it takes a finite amount of time for
the previous backend to exit; depending on scheduler priorities it's
possible for the next instance to connect and try to CREATE DATABASE
before the previous one is gone. My suggestion would be to connect
to some other database besides the one being copied.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-05-09 19:04:05 Re: Problem with "create database ... with template "
Previous Message Oleg Bartunov 2007-05-09 18:03:43 Problem with "create database ... with template "