how to remove \n within a field and copy should be flexible - Mailing list pgsql-general

From
Subject how to remove \n within a field and copy should be flexible
Date
Msg-id Pine.LNX.4.10.10002161536030.27483-100000@picasso.realtyideas.com
Whole thread Raw
In response to Re: [GENERAL] like '%6' does not match '%66'?  (<kaiq@realtyideas.com>)
List 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!!!



pgsql-general by date:

Previous
From: jamesbinary@icqmail.com (James)
Date:
Subject: postgresql newsgroups
Next
From: Brook Milligan
Date:
Subject: delete portal notice