Re: Export to file

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Marvin <magosoft(at)gmx(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Export to file
Date: 2003-09-10 09:56:09
Message-ID: 1063187769.21803.110.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Elphick(at)lfix(dot)co(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message suresh prasanna 2003-09-10 09:57:59
Previous Message Alexander V. Ivanko 2003-09-10 09:18:35 unsubscribe