pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Csaba Nagy <nagy@ecircle-ag.com>
To: Thomas Dudziak <tomdzk@gmail.com>
Cc: Postgres JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Create Database using JDBC
Date: Fri, 01 Jul 2005 12:36:00 +0200
Message-ID: <1120214160.3085.87.camel@coppola.muc.ecircle.de> (raw)
In-Reply-To: <224f3234050701032612fabe04@mail.gmail.com>
References: <2BC68159E3EC814BA1E81C108DF99A4203A37FD9@EXCH-IND-VS1.india.quark.com>
	<224f3234050701032612fabe04@mail.gmail.com>

Hi all,

I'm not too knowledgeable about this matter, but wouldn't it work to
connect to another data base, not template1 ?
And make a policy not to connect to template1.
I guess it doesn't matter which data base are you connected to (except
that it must exist) when you create a new one. So just create a
"standard" data base which always exist, and connect to that one.

Cheers,
Csaba.


On Fri, 2005-07-01 at 12:26, Thomas Dudziak wrote:
> 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
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster




view thread (20+ messages)  latest in thread

Message-ID: <1120214160.3085.87.camel@coppola.muc.ecircle.de>
Permalink:  ../1120214160.3085.87.camel@coppola.muc.ecircle.de/
Also on:    postgresql.org/message-id/1120214160.3085.87.camel@coppola.muc.ecircle.de

 · 

reply

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: nagy@ecircle-ag.com, tomdzk@gmail.com
  Subject: Re: Create Database using JDBC
  In-Reply-To: <1120214160.3085.87.camel@coppola.muc.ecircle.de>
  References: <2BC68159E3EC814BA1E81C108DF99A4203A37FD9@EXCH-IND-VS1.india.quark.com> <224f3234050701032612fabe04@mail.gmail.com> <1120214160.3085.87.camel@coppola.muc.ecircle.de>

* 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