Re: Use Driver to Create database?

From: John R Pierce <pierce(at)hogranch(dot)com>
To: Charlie Kelly <Charlie(at)CharlieKelly(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Use Driver to Create database?
Date: 2006-11-20 05:07:44
Message-ID: 45613820.6080909@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


>> First connect to the postgres or template1 schema of the cluster, that
>> you created with initdb. Execute the "CREATE DATABASE". Reconnect to the
>> database you created.
>
> You don't want to connect to template1, though, if the program is
> going to be used concurrently by more than one use. Template1 is used
> as template (hence the name) to make the new database, and it will
> throw an error if there's any other users connected to it beside the
> one issuing the CREATE DATABASE command.
>

indeed. In fact you can connect to ANY existing database prior to
issusing the CREATE DATABASE command. It is important, however, that
you be logged on with credentials that have the CREATEDB privilege

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Michael Paesold 2006-11-20 07:38:27 Re: JDBC Support for standard_conforming_strings
Previous Message Heikki Linnakangas 2006-11-19 22:04:10 Re: Use Driver to Create database?