how to remove \n within a field and copy should be flexible

From: <kaiq(at)realtyideas(dot)com>
To: pgsql-general(at)postgreSQL(dot)org
Subject: how to remove \n within a field and copy should be flexible
Date: 2000-02-16 21:55:01
Message-ID: Pine.LNX.4.10.10002161536030.27483-100000@picasso.realtyideas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


is there a way to remove \n (newline) within
the data without doing perl (or any client-side)
programming?
-----------------------------------------
background:
------------------------------------------
I'm still struggling with data loading pg->m$sql.
pg's copy does escape, but can only use \n as record separator.
If in a text field, the data contains \n (newline), pg
will escape it. however, m$sql's bcp do not escape
(braindead) [however, to be fair to them, it can let you choose record
separator]. so, from bcp sees 2 broken records.

So, I have to delete the newline within the data.

BTW, not urgent anyway, the data is not that much, I can even use
vim to remove the stuff. Anyway, it is also easy for a perl
to remove \\n . I just want a better solution.

Also, seems that pg's copy should allow select record separator,
and it's escape should be optional also. why? because copy is designed
for data transfer, it's output format should be flexible.

thanks!!!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Louis Bertrand 2000-02-17 02:58:15 ownership of DBs and tables?
Previous Message Brook Milligan 2000-02-16 21:20:25 delete portal notice