Hi,

I amn't running two copies of pgAdmin at same time. The problem is

The postgres server is running on a separate Windows XP system. I cannot be 
sure if pgAdmin is open or not on that system. I use the console way to create 
a database on that system.

createdb mehultest -h pcdsk506 -U postgres -W postgres 
Password:
createdb: database creation failed: ERROR:  source database "template1" is being
 accessed by other users

The admin of that system might be cleaning up databases or viewing or modifying 
using pgAdminIII. In such a case, I am blocked till pgAdminIII is closed by the 
system admin using the remote system. 

I think it might be a good idea for pgAdminIII to use some shared lock which 
can be used with createdb thereby allowing the remote user to create the 
database. After that pgAdminIII can just refresh it's view to see the new db, 
similar to the way it refreshes when you drop a db.

Thanks & Regards,
Mehul


-----Original Message-----
From: Tom Lane [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 31, 2005 10:10 PM
To: Dave Page
Cc: Mehul Doshi-A20614; pgsql-bugs@postgresql.org
Subject: Re: [BUGS] Template1 is locked when pgAdminIII is open 


"Dave Page" <dpage@vale-housing.co.uk> writes:
> pgAdmin uses template1 by default as it is the only accessible 
> database that we can be sure will exist. There are 2 solutions to your 
> problem:

> 1) Change your pgAdmin connection to use a different default database.

> 2) Select a different database to use as the template when creating a 
> new one.

He shouldn't really be getting that error though, as CREATE DATABASE only 
complains if there is another connection *besides your own* to the template 
database.

I think the real answer is something more along the lines of "don't run two 
copies of pgAdmin at once".

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to