proper export table to csv? multilineproblem.

From: peter pilsl <pilsl(at)goldfisch(dot)at>
To: pgsql-general(at)postgresql(dot)org
Subject: proper export table to csv? multilineproblem.
Date: 2007-02-26 13:54:24
Message-ID: 45E2E690.6080900@goldfisch.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I need to export several tables as csv. I use the \f-command to set the
seperator and pipe the output of my select directly to a file.

Unfortunately thats all the control I have over the created csv-file. I cannot
set the field-delimiter and - which is critical to me - I cannot set an
alternate record-seperator (newline at the moment). The latter is important to
me cause many of my fields-values have \n or \r in it, so the csv-import-filter
has a hard time to distinguish the record-seperator from a newline inside the data.

On the server I've postgres7.2, so the COPY-command does not know about the
CSV-option yet (not does the postgres 8).

Is there any ready tool to create flexible csv-files or any trick I did not find
out yet?

thnx,
peter

--
mag. peter pilsl - goldfisch.at
IT-Consulting
Tel: +43-650-3574035
Tel: +43-1-8900602
Fax: +43-1-8900602-15
skype: peter.pilsl
pilsl(at)goldfisch(dot)at
www.goldfisch.at

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Devrim GUNDUZ 2007-02-26 13:57:02 Re: [HACKERS] urgent: upgraded to 8.2, getting kernel panics
Previous Message Merlin Moncure 2007-02-26 13:48:18 Re: perfromance world records