X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 908B511F6554 for ; Thu, 6 Apr 2006 18:49:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41439-09 for ; Thu, 6 Apr 2006 18:49:02 -0300 (ADT) X-Greylist: delayed 00:06:38.265248 by SQLgrey- Received: from outbound-mail-22.bluehost.com (outbound-mail-22.bluehost.com [70.103.189.17]) by postgresql.org (Postfix) with SMTP id B710911F63A8 for ; Thu, 6 Apr 2006 18:49:04 -0300 (ADT) Received: (qmail 5793 invoked by uid 0); 6 Apr 2006 21:42:25 -0000 Received: from unknown (HELO box54.bluehost.com) (70.98.111.54) by mailproxy2.bluehost.com with SMTP; 6 Apr 2006 21:42:25 -0000 Received: from [65.88.67.210] (helo=betyt2kfkp61.corp.kpmgconsulting.com) by box54.bluehost.com with esmtp (Exim 4.52) id 1FRcFE-0007Dm-Mq for pgsql-sql@postgresql.org; Thu, 06 Apr 2006 15:42:24 -0600 From: kevin.kempter@dataintellect.com To: pgsql-sql@postgresql.org Subject: Re: Query from shell Date: Thu, 6 Apr 2006 15:43:16 -0600 User-Agent: KMail/1.9.1 References: <144D12D7DD4EC04F99241498BB4EEDCC28843E@nelson.osl.com> In-Reply-To: <144D12D7DD4EC04F99241498BB4EEDCC28843E@nelson.osl.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604061543.16330.kevin.kempter@dataintellect.com> X-Identified-User: {840:box54.bluehost.com:kevinkem:kevinkempterllc.com} {sentby:bopbeforesmtp 65.88.67.210 authed with kevinkempterllc.com} X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.55 required=5 tests=[NO_REAL_NAME=0.55] X-Spam-Score: 0.55 X-Spam-Level: X-Archive-Number: 200604/50 X-Sequence-Number: 24859 On Thursday 06 April 2006 15:37, Owen Jacobson wrote: > 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 I think you can also run: psql -f filename.sql database_name