From: Thomas Dudziak <tomdzk@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Create Database using JDBC
Date: Fri, 1 Jul 2005 12:26:03 +0200
Message-ID: <224f3234050701032612fabe04@mail.gmail.com> (raw)
In-Reply-To: <2BC68159E3EC814BA1E81C108DF99A4203A37FD9@EXCH-IND-VS1.india.quark.com>
References: <2BC68159E3EC814BA1E81C108DF99A4203A37FD9@EXCH-IND-VS1.india.quark.com>
On 7/1/05, Nidhi Srivastava <nsrivastava@quark.com> wrote:
> I wish to create a database if one doesn't exist using JDBC. I tried
> connecting to template1 database and then issuing the "CREATE DATABASE test"
> command but I get the following error :
>
> ERROR: CREATE DATABASE: source database "template1"
> is being accessed by other users
>
> How do I resolve this? I'm using PostGreSQL8.0
This should work (we're doing it exactly the same way). But there can
only be one user connected at a time to the template database, it
seems, at least when using the CREATE DATABASE command. Do you have
the one of the PostgreSQL tools open, eg. pgAdmin ?
Tom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: tomdzk@gmail.com
Subject: Re: Create Database using JDBC
In-Reply-To: <224f3234050701032612fabe04@mail.gmail.com>
References: <2BC68159E3EC814BA1E81C108DF99A4203A37FD9@EXCH-IND-VS1.india.quark.com> <224f3234050701032612fabe04@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox