pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jie Liang <jliang@ipinc.com>
To: Milen <milend@ansco.com>
Cc: 'pgsql-sql@postgresql.org.' <pgsql-sql@postgresql.org>
Subject: Re: batch file
Date: Fri, 25 May 2001 11:04:14 -0700 (PDT)
Message-ID: <Pine.BSF.4.10.10105251059040.61843-100000@tidal.ipinc.com> (raw)
In-Reply-To: <01C0E51F.F2E673F0.milend@ansco.com>

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
> 




view thread (7+ messages)  latest in thread

Message-ID: <Pine.BSF.4.10.10105251059040.61843-100000@tidal.ipinc.com>
Permalink:  ../Pine.BSF.4.10.10105251059040.61843-100000@tidal.ipinc.com/
Also on:    postgresql.org/message-id/Pine.BSF.4.10.10105251059040.61843-100000@tidal.ipinc.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: jliang@ipinc.com, milend@ansco.com
  Subject: Re: batch file
  In-Reply-To: <Pine.BSF.4.10.10105251059040.61843-100000@tidal.ipinc.com>
  References: <01C0E51F.F2E673F0.milend@ansco.com> <Pine.BSF.4.10.10105251059040.61843-100000@tidal.ipinc.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox