Re: [Question]batch execute sql command - Mailing list pgsql-general

From Michael Fuhr
Subject Re: [Question]batch execute sql command
Date
Msg-id 20050424140722.GA66210@winnie.fuhr.org
Whole thread Raw
In response to [Question]batch execute sql command  (neo anderson <freeonfair@yahoo.co.uk>)
List pgsql-general
On Sun, Apr 24, 2005 at 02:08:33PM +0100, neo anderson wrote:
>
> i encounter a question when create database schema.
> because i have a sql script, in which contains lots of
> sql command, including insert, create table, create
> index and so on. however, i do know weather postgresql
> supports batch executing sql script or not, for i try
> to run scrtip like what oracle does; yet it seemly
> doesn't  work. would anyone please to telll me how to
> do that?

From within psql you can run "\i filename"; from the command line
you can run "psql -f filename" or, if your shell supports redirection,
"psql < filename".  See the psql documentation for details:

http://www.postgresql.org/docs/8.0/interactive/app-psql.html

If that's not what you're looking for, then please provide more
information about what you're trying to do.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Locale question
Next
From: Karsten Hilbert
Date:
Subject: Re: timezone() with timeofday() converts the wrong direction?