creating database fails on windows XP: Postgres 8.0

From: "Jain, Neeraj" <neeraj(dot)jain(at)wincor-nixdorf(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: creating database fails on windows XP: Postgres 8.0
Date: 2004-11-01 07:35:26
Message-ID: D90823863B575F4BB4E3CEA49A79CF1004517D89@sgpwn04a.wincor-nixdorf.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,
I am getting following error while trying to create a new database
called mydb on my newly installed postgres 8.0 version on XP.
Following is the code from build.xml that is being executed by ant. The
"classpathref="my.classpath"> line gives the
"BUILD FAILED D:\project\build.xml:48:
org.postgresql.util.PSQLException: ERROR: CREATE DATABASE cannot run inside
a transaction block" error.

Code from build.xml:
<target name="db.create.postgres.mydb">
<sql driver="${database.driver.postgres}"
url="${base-database.url.postgres}"
userid="${database.rootuser.postgres}"
password="${database.rootpassword.postgres}"
src="${db-script.postgres}"
classpathref="my.classpath">
</sql>
</target>

The db-scripts.posgres points to a file containing following text.

CREATE USER myuser PASSWORD 'mypasswd';
CREATE DATABASE mydb TEMPLATE template0 OWNER myuser;
GRANT ALL PRIVILEGES ON DATABASE mydb to myuser;

Appreciate any help.

Regards,
Neeraj Jain.

Browse pgsql-admin by date

  From Date Subject
Next Message azariah jason 2004-11-01 13:38:06 initlocation -- command not found -- HELP NEEDED
Previous Message Iain 2004-11-01 06:35:21 Re: pg_restore TODO - delay PK creation