Skip site navigation (1) Skip section navigation (2)

Using Batch Files to Create DB Structure

From: Don Parris <gnumathetes(at)gmail(dot)com>
To: PGSQL-Novice List <pgsql-novice(at)postgresql(dot)org>
Subject: Using Batch Files to Create DB Structure
Date: 2005-07-14 05:55:48
Message-ID: 669261440507132255681c520a@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Greetings,

I'm coming over from MySQL.  I'm running SUSE Linux 9.2, running PGSQL 7.4.8.

In MySQL, I could use a simple batch file to run all my table creation
statements:
mysql -u user -p mydb < /file/path/batchfile.sql

Is this possible with PGSQL?  Can I do this, for instance:
psql -W mydb < /file/path/batchfile.sql

and get all my tables created?

Or is this why there are a dozen languages for server programming?  If
redirecting the input from a batchfile is possible, please point me to
the right documentation..  If not, I'll go back to the languages
section of the manual.  Many thanks in advance.

Don
-- 
DC Parris GNU Evangelist
http://matheteuo.org/
gnumathetes(at)gmail(dot)com
Free software is like God's love - 
you can share it with anyone anywhere anytime!

Responses

pgsql-novice by date

Next:From: Kirsten WahlstromDate: 2005-07-14 07:05:31
Subject: rowtypes and functions
Previous:From: Keith WorthingtonDate: 2005-07-14 04:34:07
Subject: Re: view data types

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group