Postgres database creation using batch files

From: PresleyDias <presley(at)umangsoftware(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Postgres database creation using batch files
Date: 2011-11-21 07:54:50
Message-ID: 1321862090073-5009739.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

i want to create a postgres database using batch file, now the normal way of
doing this is

"C:\Program Files\PostgreSQL\9.0\bin\createdb.exe" -U Myadmin MydatAbseName

this create a database with the default database parameters, but i want to
create a database with the following parameter

WITH OWNER = Myadmin
TEMPLATE = template0
ENCODING = 'SQL_ASCII'
TABLESPACE = pg_default
LC_COLLATE = 'C'
LC_CTYPE = 'C'
CONNECTION LIMIT = -1;

Please tell me how to create a database with the above parameter using Batch
files.

also how to use a .sql file to do the same, like this "C:\Program
Files\PostgreSQL\9.0\bin\createdb.exe" -U Myadmin -f C:\createDB.sql;

thanks in advanced:)

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-database-creation-using-batch-files-tp5009739p5009739.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2011-11-21 14:51:00 Re: Upgrading DBs with type=citext from 9.0.5 to 9.1.1 using pg_upgrade and create extension
Previous Message Rudolf van der Leeden 2011-11-20 22:11:36 Upgrading DBs with type=citext from 9.0.5 to 9.1.1 using pg_upgrade and create extension