From: Kris Jurka <books@ejurka.com>
To: Nidhi Srivastava <nsrivastava@quark.com>
Cc: Thomas Dudziak <tomdzk@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Cc: John R Pierce <pierce@hogranch.com>
Subject: Re: Create Database using JDBC
Date: Mon, 4 Jul 2005 04:30:53 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0507040428390.12238@leary.csoft.net> (raw)
In-Reply-To: <2BC68159E3EC814BA1E81C108DF99A4203A37FDC@EXCH-IND-VS1.india.quark.com>
References: <2BC68159E3EC814BA1E81C108DF99A4203A37FDC@EXCH-IND-VS1.india.quark.com>
On Mon, 4 Jul 2005, Nidhi Srivastava wrote:
> Even when I'm not accessing templte1 but any other scratch database
> through pgAdmin and try to create a new DB using JDBC I get the same
> ERROR: CREATE DATABASE: source database "template1" is being accessed
> by other users. Is there a way to check if a DB exists and create it if
> it doesn't using JDBC. How can I ensure that pgAdmin is not open on any
> of the client machines and connected to the Postgre server on my
> machine....becuase if even a single pgAdmin client is open on any of the
> client machines it doesn't allow me to create a new DB throwing the
> above error.
>
I would suggest using an alernate template database to create new
databases with. You could even mark it to refuse connections to ensure no
one else will connect to it and block your operation.
Kris Jurka
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: books@ejurka.com, nsrivastava@quark.com, tomdzk@gmail.com, pierce@hogranch.com
Subject: Re: Create Database using JDBC
In-Reply-To: <Pine.BSO.4.56.0507040428390.12238@leary.csoft.net>
References: <2BC68159E3EC814BA1E81C108DF99A4203A37FDC@EXCH-IND-VS1.india.quark.com> <Pine.BSO.4.56.0507040428390.12238@leary.csoft.net>
* 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