Re: Postgres database creation using batch files

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Postgres database creation using batch files
Date: 2011-11-22 18:27:36
Message-ID: jagpim$ikk$2@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

PresleyDias wrote on 21.11.2011 08:54:
> 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;
>

What's wrong with the answer you got on Stackoverflow?

http://stackoverflow.com/questions/8208181/create-posgtres-database-using-batch-file-with-template-encoding-owner-an

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Craig Ringer 2011-11-23 00:23:28 Re: silent installer
Previous Message Skusa, Andre 2011-11-22 17:06:32 silent installer