or

psql db <<EOQ
select...;
delete...;
update...;
\q
EOQ



---------- Original Message -----------
From: "Owen Jacobson" <[EMAIL PROTECTED]>
To: <pgsql-sql@postgresql.org>
Sent: Thu, 6 Apr 2006 14:37:51 -0700
Subject: Re: [SQL] Query from shell

> Judith wrote:
> 
> >        Hi every body, somebody can show me hot to execute a 
> > query from a shell
> 
> echo QUERY HERE | psql databasename
> 
> Or, if you want to run several queries, run psql and run your queries there.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
------- End of Original Message -------


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to