Re: exporting quoted CSV data from a query

From: David Fetter <david(at)fetter(dot)org>
To: George Pavlov <gpavlov(at)mynewplace(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: exporting quoted CSV data from a query
Date: 2006-05-09 02:21:59
Message-ID: 20060509022159.GA2720@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, May 08, 2006 at 12:26:48PM -0700, George Pavlov wrote:
> Is there a way to export the output of an arbitrary SQL query to a
> quoted CSV file?

For now, you can do it with a temp table, as in:

BEGIN;
CREATE TEMP TABLE my_temp AS SELECT ...;
COPY my_temp ... ;
ROLLBACK;

HTH :)

Cheers,
D
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jaime Casanova 2006-05-09 04:37:37 Re: [GENERAL] recuperar el nro del registro actualizado utilizando Ado
Previous Message leo camalig 2006-05-09 01:37:31 How to allow non-local to postgreSQL