Re: [Question]batch execute sql command

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: neo anderson <freeonfair(at)yahoo(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [Question]batch execute sql command
Date: 2005-04-24 14:07:23
Message-ID: 20050424140722.GA66210@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2005-04-24 15:21:41 Re: timezone() with timeofday() converts the wrong direction?
Previous Message Matthew T. O'Connor 2005-04-24 13:45:42 Locale question