creating database fails on windows XP: Postgres 8.0 - Mailing list pgsql-admin

From Jain, Neeraj
Subject creating database fails on windows XP: Postgres 8.0
Date
Msg-id D90823863B575F4BB4E3CEA49A79CF1004517D89@sgpwn04a.wincor-nixdorf.com
Whole thread Raw
List 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.

pgsql-admin by date:

Previous
From: "Iain"
Date:
Subject: Re: pg_restore TODO - delay PK creation
Next
From: Edgars
Date:
Subject: postgres gets slower after some while