Re: Create Database using JDBC - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Create Database using JDBC
Date
Msg-id 42C51B37.4010603@opencloud.com
Whole thread Raw
In response to Create Database using JDBC  ("Nidhi Srivastava" <nsrivastava@quark.com>)
List pgsql-jdbc
Nidhi Srivastava 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

This is no different for JDBC versus createdb. You can't use a database
as a source for CREATE DATABASE if it has more than one active
connection. I suspect you will find that 'createdb' fails with the same
error..

-O

pgsql-jdbc by date:

Previous
From: Thomas Dudziak
Date:
Subject: Re: Create Database using JDBC
Next
From: Csaba Nagy
Date:
Subject: Re: Create Database using JDBC