copy command - Mailing list pgsql-admin

From Zhang, Anna
Subject copy command
Date
Msg-id 5511D658682A7740BA295CCF1E1233A635A823@vsvapostal2.bkup3
Whole thread Raw
List pgsql-admin
I have a problem to load data to postgres database using copy command. The
problem is that we have one column called address which is multi-line text,
the taxt file looks like this:

aab770|awkc.com administration|sultan 23
Bogota, na00000|CO

above shows one record with '|' as delimiters. Column 3 has two lines which
caused the record is splited into two lines. If I use copy command to load
this record, it is always treated as two records. Is there any way to tell
postgres to read until reach a specified char? not stop at '\n'?
Or maybe edit the text file to make it one line, but how?  We have milions
of such records in the text file.
Anyone can provide a solution, thanks a million!

Anna Zhang


pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: usetrace column in pg_shadow and pg_user
Next
From: Isabelle Brette
Date:
Subject: Re: copy command