Skip site navigation (1) Skip section navigation (2)

Creating database problem

From: "M(dot)A(dot) Oude Kotte" <marc(at)solcon(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: Creating database problem
Date: 2004-10-29 10:12:45
Message-ID: 4182179D.403@solcon.nl (view raw or flat)
Thread:
Lists: pgsql-general
Hi All,

I'm unsure if this is the correct mailinglist for my question. I have a 
problem with CREATE DATABASE, but as the docs state that officially this 
is not an SQL statement, I was unsure if I should subscribe to pgsql-sql 
or pgsql-general.

NOTE: I've searched on google, postgresql.org, FAQ's and the 
static/dynamic documentation, but I couldn't find a solution to my problem.

When I try to execute "CREATE DATABASE somename" while connected to 
database template1 as a non-superuser with createdb-rights, I get the 
error message "source database "template1" is being accessed by other 
users". This is correct, as I'm connected to the same server using 
pgAdmin III on a different PC. But my question is, why this error 
message? I understand that I need to be using at least _some_ database 
in other to connect. But why can I only create a new database (which, as 
far as I know, has nothing to do with template1 itself) if I'm the only 
connected user? Or am I missing something? I do need to be able to 
create databases while other users are connected.

I've used MySQL in the past, which allows a user to create databases 
whenever he likes, no matter how many people are connected. I expected 
Postgres to do the same, but maybe I'm doing something wrong... :)

Thanks in advance for any help!

Marc

Responses

pgsql-general by date

Next:From: Marco ColomboDate: 2004-10-29 10:38:29
Subject: Re: Reasoning behind process instead of thread based
Previous:From: Martijn van OosterhoutDate: 2004-10-29 09:34:12
Subject: Re: Question Regarding Locks

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group