pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Marvin <magosoft@gmx.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Export to file
Date: Wed, 10 Sep 2003 10:56:09 +0100
Message-ID: <1063187769.21803.110.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <3F5DFCA5.000006.00924@guaj215desa>
References: <3F5DFCA5.000006.00924@guaj215desa>

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 




view thread (4+ messages)  latest in thread

Message-ID: <1063187769.21803.110.camel@linda.lfix.co.uk>
Permalink:  ../1063187769.21803.110.camel@linda.lfix.co.uk/
Also on:    postgresql.org/message-id/1063187769.21803.110.camel@linda.lfix.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: olly@lfix.co.uk, magosoft@gmx.net
  Subject: Re: Export to file
  In-Reply-To: <1063187769.21803.110.camel@linda.lfix.co.uk>
  References: <3F5DFCA5.000006.00924@guaj215desa> <1063187769.21803.110.camel@linda.lfix.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox