Query from shell

Поиск
Список
Период
Сортировка
Искать

Query from shell

От:
Judith <jaltamirano@correolux.com.mx>
Дата:
      Hi every body, somebody can show me hot to execute a query from a 
shell
   thanks in advanced!!!


Re: Query from shell

От:
"Owen Jacobson" <ojacobson@osl.com>
Дата:
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.

Re: Query from shell

От:
Bricklen Anderson <banderson@presinet.com>
Дата:
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  -c "your query here"

Re: Query from shell

От:
Terry Lee Tucker <terry@esc1.com>
Дата:

On Thursday 06 April 2006 02:37 pm, Judith saith:
>        Hi every body, somebody can show me hot to execute a query from a
> shell
>
>     thanks in advanced!!!
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org

Do this:
psql  -c 'SELECT code FROM cust' rnd;


Re: Query from shell

От:
kevin.kempter@dataintellect.com
Дата:
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

Re: Query from shell

От:
"Jim Buttafuoco" <jim@contactbda.com>
Дата:
or

psql db <
To: 
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 -------


FAQ