Re: using copy to load odd characters

From: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
To: "''pgsql-general(at)postgresql(dot)org ' '" <pgsql-general(at)postgresql(dot)org>
Subject: Re: using copy to load odd characters
Date: 2003-10-08 13:45:28
Message-ID: 73309C2FDD95D11192E60008C7B1D5BB05FED9F4@snt452.corp.bcbsm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--howdy:

--to reiterate the problem, i am simply doing
--a copy of a text file into a table:

[snip example]

testdb> \copy t_test1 from '/var/tmp/results.txt' with delimiter as '|'

[/snip example]

--the problem was that there were ^@ characters in the file
--and PostgreSQL didn't / couldn't load the data and terminated
--the process.

--my solution was to split the large files and, with VI,
--removed the ^@ characters by hand. the copy went
--as expected.

--i expected PostgreSQL to load the data, regardless
--of what was in the file. i'm only saying i 'expected'
--this because i've loaded the same file into the same
--table structure as DB2 (also my source for this file)
--and Oracle 9 with no problem. my apologies for assuming.

--i suppose my next question could be 'why couldn't
--PostgreSQL load characters like this into a table?'
--but it seems like the best thing for future events
--is to write a perl script to scan the text files and
--remove them before loading the data.

--thanks!

>Totally impossible to tell unless you tell us
>exactly what you are doing
>and what you expected out of it.

-X

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-10-08 14:06:25 Re: Does postgresql support HKSCS ?
Previous Message Harry Broomhall 2003-10-08 11:23:04 UPDATE and outer joins