Re: Running a query from the OS CLI

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Running a query from the OS CLI
Date: 2007-08-08 18:42:48
Message-ID: 84D155BE-7F21-4565-AD9B-C4C788852F73@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Aug 8, 2007, at 13:13 , Gauthier, Dave wrote:

> If I have a DB called "foo"

psql --dbname "foo"

>
> ...and...
>
> I want to run "select name from table_a where name like 'john%'"

psql --dbname "foo" -c "select name from table_a where name like 'john
%'"

>
> ...and...
>
> I want no table header "NAME" in the output

psql --dbname "foo" -c "select name from table_a where name like 'john
%'" -t

>
> ...and...
>
> I want to do this as a one-liner from the linux command line

check.

>
> ...and...
>
> I don't want to have to deal with intermediate files or home-grown
> programs...

Does that work?

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Atkins 2007-08-08 18:48:07 Re: Running a query from the OS CLI
Previous Message Dann Corbit 2007-08-08 18:38:19 Re: Running a query from the OS CLI