Re: Query from shell

Lists: pgsql-sql
From: "Owen Jacobson" <ojacobson(at)osl(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Query from shell
Date: 2006-04-06 21:37:51
Message-ID: 144D12D7DD4EC04F99241498BB4EEDCC28843E@nelson.osl.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

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.


From: Bricklen Anderson <banderson(at)presinet(dot)com>
To: Owen Jacobson <ojacobson(at)osl(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Query from shell
Date: 2006-04-06 21:39:44
Message-ID: 44358AA0.7000201@presinet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

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.
>
or
psql -d <dbname> -c "your query here"


From: kevin(dot)kempter(at)dataintellect(dot)com
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Query from shell
Date: 2006-04-06 21:43:16
Message-ID: 200604061543.16330.kevin.kempter@dataintellect.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

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


From: "Jim Buttafuoco" <jim(at)contactbda(dot)com>
To: "Owen Jacobson" <ojacobson(at)osl(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Query from shell
Date: 2006-04-06 22:56:42
Message-ID: 20060406225547.M95598@contactbda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

or

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

---------- Original Message -----------
From: "Owen Jacobson" <ojacobson(at)osl(dot)com>
To: <pgsql-sql(at)postgresql(dot)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 -------