Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 59AFD9F9386 for ; Mon, 11 Dec 2006 17:19:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 55153-07 for ; Mon, 11 Dec 2006 17:19:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from presinet.com (mail.presinet.com [209.53.156.1]) by postgresql.org (Postfix) with ESMTP id 5BF1B9F931E for ; Mon, 11 Dec 2006 17:19:09 -0400 (AST) Received: from [10.10.1.151] ([10.10.1.151]) by presinet.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 11 Dec 2006 13:18:19 -0800 Message-ID: <457DCB49.300@presinet.com> Date: Mon, 11 Dec 2006 13:19:05 -0800 From: Bricklen Anderson User-Agent: Thunderbird 1.5.0.8 (X11/20061117) MIME-Version: 1.0 To: Naomi Walker CC: "pgsql-admin@postgresql.org" Subject: Re: Simple Unload References: <8397.1165647371@sss.pgh.pa.us> <18891.1165686391@sss.pgh.pa.us> <1165865427.3816.90.camel@silverbirch.site> <457DC371.8060107@eldocomp.com> In-Reply-To: <457DC371.8060107@eldocomp.com> Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Dec 2006 21:18:19.0218 (UTC) FILETIME=[E14F2320:01C71D69] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/152 X-Sequence-Number: 23944 Naomi Walker wrote: > From time to time, I need to unload rows to a delimited file, > specifically with a "where" clause. > I've cobbled a script together to do this, but it seems like a > reasonable utility to support. Sort > of a pg_dump on steroids.. > > Have I missed the simple way to do this? Would someone consider adding > such a utility or adding > this to pg_dump? > > Naomi 8.2 COPY appears to be able to output in csv format, using a WHERE clause, though I've not tried it. http://www.postgresql.org/docs/8.2/static/sql-copy.html