Re: Command line output - How to output values only?

From: Charley Tiggs <lists(at)tiggs(dot)net>
To: sdger erger <killen(dot)nextdoor(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Command line output - How to output values only?
Date: 2008-01-09 22:03:55
Message-ID: 478544CB.80108@tiggs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

If you mean while using psql with the -c switch, add -t.

psql -t dbname username -c "select * from foo" > data_file.txt

If you mean from within the client environment, use \t.

Charley

sdger erger wrote:
> When I retrieve SQL queries through the command line I get outputs like:
>
> *Code:*
> Title
> -------
> value
> (1 row)
>
>
> Is there anything I can do, any option I can choose, to retrieve only the
> value?
>
> *Code*
> value
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Charley Tiggs 2008-01-09 22:06:40 psql record separator
Previous Message Michael Smith 2008-01-09 22:01:17 Re: Creating a tablespace on an external server in Windows