Re: batch file - Mailing list pgsql-sql

From Jie Liang
Subject Re: batch file
Date
Msg-id Pine.BSF.4.10.10105251059040.61843-100000@tidal.ipinc.com
Whole thread Raw
In response to batch file  (Milen <milend@ansco.com>)
List pgsql-sql
Hi,

I am not sure what's your question.
However, you can list a bunch of SQL statements in a text file:
e.g.
myfile.sql which contains:

select * from tablename where ....
update tablename set ... where ...
.....

then, you can just run it like:


psql -q dbname < myfile.sql




Jie LIANG

St. Bernard Software

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang@ipinc.com
www.stbernard.com
www.ipinc.com

On Fri, 25 May 2001, Milen wrote:

> Hi all!,
> 
> I want to execute several SQL statements one after another.
> Does anyone know if it is possible to create something like a "batch file" 
> which contains all SQL commands I want.
> 
> Best Regards:
> Milen
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html
> 



pgsql-sql by date:

Previous
From: Jason Earl
Date:
Subject: Re: batch file
Next
From: Peter Eisentraut
Date:
Subject: Re: batch file