I want to create a Postgres database using a batch file. Now the normal way of doing this is the following:
"C:\Program Files\PostgreSQL\9.0\bin\createdb.exe" -U Myadmin MydatAbseName
This script above creates a database with the default database parameters. However, I want to create a database with the following parameters, as follows:
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 parameters using Batch files.
Also let me know how to use a .sql file to do the same, like this command-line:
"C:\Program Files\PostgreSQL\9.0\bin\createdb.exe" -U Myadmin -f C:\createDB.sql;