Creating database problem - Mailing list pgsql-general

From M.A. Oude Kotte
Subject Creating database problem
Date
Msg-id 4182179D.403@solcon.nl
Whole thread Raw
Responses Re: Creating database problem  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Re: Creating database problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Question Regarding Locks
Next
From: Karsten Hilbert
Date:
Subject: Re: Question Regarding Locks