How To: LARGE html text or csv file COPY FROM?

From: Lou Picciano <loupicciano(at)comcast(dot)net>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: How To: LARGE html text or csv file COPY FROM?
Date: 2010-09-15 13:03:16
Message-ID: 594168409.400001.1284555796001.JavaMail.root@sz0093a.westchester.pa.mail.comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello Friends,

We're trying something for the first time: A COPY into a database, from a TEXT (or CSV) file containing one really, really, big field of html.

The field happens to be content of complete webpages, which we then need to later analyze, slice, dice, etc. - so it's verbatim html, with all the carriage returns, spaces, linefeeds(?) and double quotes included!

Problem is: With the very first record, the COPY commands hiccups with: missing data from column error.
in CSV mode, it's 'extra data after last expected column' (yes, using different input files for test).

Both errors above make sense to me; COPY is running into either a cr or a tab character in each case.

Q: Is there way to handle this directly, as a PG import?

Meanwhile, we're off into using grep/gawk to remove all carriage returns in the field?

TIA for any help, inspiration, recipes (or time in the stocks). Lou

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2010-09-15 13:35:20 Re: issue with Postgres uninstallation
Previous Message Anuj Pankaj 2010-09-15 09:39:07 issue with Postgres uninstallation