From: Oliver Jowett <oliver@opencloud.com>
To: Nidhi Srivastava <nsrivastava@quark.com>
Cc: Thomas Dudziak <tomdzk@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Create Database using JDBC
Date: Tue, 05 Jul 2005 12:03:30 +1200
Message-ID: <42C9CE52.7080908@opencloud.com> (raw)
In-Reply-To: <2BC68159E3EC814BA1E81C108DF99A4203A37FE6@EXCH-IND-VS1.india.quark.com>
References: <2BC68159E3EC814BA1E81C108DF99A4203A37FE6@EXCH-IND-VS1.india.quark.com>
Nidhi Srivastava wrote:
> Problem is if any client application is connected to another database on
> my server anywhere, I shall not able to create my database using
> template1. How can I determine which other clients are connected to my
> server?
It's not "another database", it is specifically the database that you
are using as the template for CREATE DATABASE that must be idle. See the
CREATE DATABASE docs for details.
Usually template1 is not used for anything else so there's no problem. I
suspect that pgAdmin is connecting to template1 *as well* as to the
database you request -- so just the act of running it means that noone
else can CREATE DATABASE from template1.
Whatever database you end up using as a template, you will need to
ensure that there's noone else connected to it. If having random users
connect to the template DB is a problem, then consider using pg_hba.conf
to enforce this -- i.e. don't let people connect to template1 in the
first place unless they are a particular user who is allowed to CREATE
DATABASE..
This is not JDBC-specific though. I suggest you take the discussion to
pgsql-general where there's a wider audience and you may get more help.
-O
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: oliver@opencloud.com, nsrivastava@quark.com, tomdzk@gmail.com
Subject: Re: Create Database using JDBC
In-Reply-To: <42C9CE52.7080908@opencloud.com>
References: <2BC68159E3EC814BA1E81C108DF99A4203A37FE6@EXCH-IND-VS1.india.quark.com> <42C9CE52.7080908@opencloud.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