Re: Export to file - Mailing list pgsql-admin

From Oliver Elphick
Subject Re: Export to file
Date
Msg-id 1063187769.21803.110.camel@linda.lfix.co.uk
Whole thread Raw
In response to Export to file  ("Marvin" <magosoft@gmx.net>)
List pgsql-admin
On Tue, 2003-09-09 at 17:15, Marvin wrote:
> Hi,
> There is a way to export the result
> of a query into an external DBF or TXT table?
>

You can't write out a DBF file without some other software, but writing
a text file is easy.  In an interactive session of psql, use:

        \o filename

You probably also want:

        \pset format unaligned
        \pset fieldsep ','
        \t

That would produce a text file with comma-separated values and no
headings.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Draw near to God and he will draw near to you.
      Cleanse your hands, you sinners; and purify your
      hearts, you double minded."       James 4:8


pgsql-admin by date:

Previous
From: "Alexander V. Ivanko"
Date:
Subject: unsubscribe
Next
From: suresh prasanna
Date:
Subject: ...