Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id B62429F37F0 for ; Tue, 22 Nov 2011 14:30:20 -0400 (AST) Received: from lo.gmane.org ([80.91.229.12]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RSv6p-0007Qf-FT for pgsql-admin@postgresql.org; Tue, 22 Nov 2011 18:30:20 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RSv6b-0004JV-GX for pgsql-admin@postgresql.org; Tue, 22 Nov 2011 19:30:05 +0100 Received: from host-188-174-136-37.customer.m-online.net ([188.174.136.37]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Nov 2011 19:30:05 +0100 Received: from spam_eater by host-188-174-136-37.customer.m-online.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Nov 2011 19:30:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-admin@postgresql.org From: Thomas Kellerer Subject: Re: Postgres database creation using batch files Date: Tue, 22 Nov 2011 19:27:36 +0100 Lines: 28 Message-ID: References: <1321862090073-5009739.post@n5.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: host-188-174-136-37.customer.m-online.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <1321862090073-5009739.post@n5.nabble.com> X-Archive-Number: 201111/113 X-Sequence-Number: 38707 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