COPY with multiple character delimiter?

From: "Celia McInnis" <celia(at)drmath(dot)ca>
To: pgsql-novice(at)postgresql(dot)org
Subject: COPY with multiple character delimiter?
Date: 2005-05-25 16:14:13
Message-ID: 20050525154857.M17589@drmath.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I will frequently have very large files of data which I'd like to be able to
load quickly into a database, but the delimiter used in the files is not a
single character (since the data could contain any character, a multiple
character delimiter was used). Hence I unfortunately can't use the postgresql
COPY command.

What's my best way of proceeding? Here are two possiblities I can think of:

1. Escape all of the tabs in my data, change the multiple-character delimiter
to a tab and then use copy.

2. Write a little perl script which does line by line processing and
inserting.

Is there any plan to have the COPY command allow multiple character
delimiters?

Also, I just read a user comment on the postgresql site
http://www.postgresql.org/docs/7.4/interactive/sql-copy.html that I may have
to escape some high-ascii values anyway. Is this true?

If so, can somebody send me the guy's filter program? I'm at work and his
site is not reachable from here. (I've never seen pornographic c code
before :-), but that's the message my work is giving me when denying me
access to his code at http://www.neverlight.com/~mental/pginput-filter.c )

Thanks,
Celia McInnis

Browse pgsql-novice by date

  From Date Subject
Next Message Kevin Crenshaw 2005-05-25 16:16:15 Re: Unable to Delete a Row
Previous Message Sean Davis 2005-05-25 15:45:22 Re: Migration from MySQL