Search Postgresql Archives

Re: Controlling psql output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2009-05-08, Gauthier, Dave <dave.gauthier@xxxxxxxxx> wrote:
> --_000_482E80323A35A54498B8B70FF2B87980040106E94Bazsmsx504amrc_
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> Hi:
>
> Using a single psql command to generate stdout in linux that will be redire=
> cted to a file.  Many rows with 1 column are returned.  I want no header, n=
> o footer, no blank lines at the top or bottom, no initial space before each=
>  record.  This is what I'm trying...
>
> psql -P tuples_only=3Don,footer=3Doff,border=3D0 mydb
>
> This gets rid of the header and footer OK.  But there is still a blank line=
>  as the first line in stdout.  Also, each record has a preceding space befo=
> re the column value.
>
> Is there a way to do what I want?

use "copy (select ...) to stdout" instead of "select ..."

requires 8.3 or greater.
as a bonus nulls and control characters re represented unambiguously.




-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux