copy command

From: "Zhang, Anna" <azhang(at)verisign(dot)com>
To: "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>
Subject: copy command
Date: 2002-01-03 17:10:01
Message-ID: 5511D658682A7740BA295CCF1E1233A635A823@vsvapostal2.bkup3
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-admin by date

  From Date Subject
Next Message Isabelle Brette 2002-01-03 18:16:39 Re: copy command
Previous Message Tom Lane 2002-01-03 15:08:03 Re: usetrace column in pg_shadow and pg_user