Race condition in dropdb;createdb

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Race condition in dropdb;createdb
Date: 2005-10-03 22:35:02
Message-ID: 20051003223502.GS40138@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

decibel(at)phonebook(dot)1[17:32]~:1%createdb test;
CREATE DATABASE
decibel(at)phonebook(dot)1[17:32]~:2%dropdb test; createdb test;
DROP DATABASE
createdb: database creation failed: ERROR: source database "template1"
is being accessed by other users
decibel(at)phonebook(dot)1[17:32]~:3%

I realize that the changes made in 8.1 WRT using the postgres database
fix this particular case, but is there a bigger issue with there being a
race condition here? Presumably dropdb returns before the connection is
actually closed from the database's standpoint...
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-10-03 23:11:24 Re: COPY in readonly transaction.
Previous Message Alon Goldshuv 2005-10-03 22:22:17 COPY in readonly transaction.