View Single Post

   
  #3 (permalink)  
Old 04-15-2008, 11:22 PM
Oliver Jowett
 
Posts: n/a
Default Re: Create Database using 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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote