X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A5191D1B542 for ; Wed, 10 Sep 2003 09:56:28 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 22663-01 for ; Wed, 10 Sep 2003 06:55:59 -0300 (ADT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 0FA89D1B547 for ; Wed, 10 Sep 2003 06:55:56 -0300 (ADT) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 19x1he-00053N-0Z; Wed, 10 Sep 2003 10:55:58 +0100 Received: from [192.168.1.1] (helo=allhosts) by cerberus.lfix.co.uk with esmtp (Exim 4.22) id 19x1hg-0007Te-M7; Wed, 10 Sep 2003 10:56:00 +0100 Subject: Re: Export to file From: Oliver Elphick To: Marvin Cc: pgsql-admin@postgresql.org In-Reply-To: <3F5DFCA5.000006.00924@guaj215desa> References: <3F5DFCA5.000006.00924@guaj215desa> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1063187769.21803.110.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 10 Sep 2003 10:56:09 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/171 X-Sequence-Number: 10259 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