PostgreSQL: copying data from file
Greetings,
great thanks to Paul Ramsey, Mr. Ramaswamy, Ulf Mehlig and
Peter Mount for their useful advices!
Well, now I have the following problem: base exported from
VFoxPro (with delimiters '|') contains russian characters
and command 'copy' produces the error:
// unreadable symbols are russian letters
rscexamdb=> copy exam with oids from '/opt2/home3/auricvision/db.txt'
using delimiters '|';
WARN:pg_atoi: error in "О©╫ О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫
О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫:": can't parse "О©╫
О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫
О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫:"
rscexamdb=>
exam is table with fields char(1024), char(100), char(100),
char(100), char(100), int, int, int, int, int, int and I
can't imagine why the error is in 'pg_atoi' function -
it seems to be postgres tryes to convert first string of
data file to integer (althrouh first field in the table is
char(1024))!
What should I do with it? May be I should use copy the
file as binary one?
P.S.: command '\copy' (\copy exam from db.txt) in psql says
'Broken pipe.' and just quits.
--
BEST WISHES, Mitlas
Webmaster, Auric Vision Ltd.
http://www.auricvision.com/
Hello!
On Thu, 26 Nov 1998, Dmitry Iv Popov wrote:
Well, now I have the following problem: base exported from
VFoxPro (with delimiters '|') contains russian characters
and command 'copy' produces the error:// unreadable symbols are russian letters
rscexamdb=> copy exam with oids from '/opt2/home3/auricvision/db.txt'
using delimiters '|';
WARN:pg_atoi: error in "О©╫ О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫
О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫:": can't parse "О©╫
О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫
О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫ О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫:"
rscexamdb=>
Looks strange. I am using postgres with russian with great success:
COPY positions FROM stdin USING DELIMITERS '|';
1|О©╫О©╫О©╫О©╫О©╫О©╫О©╫|1|"5 days"|15|1|A
2|О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫|1|"5 days"|15|2|A
3|О©╫О©╫О©╫О©╫О©╫О©╫|2|"5 days"|15|3|A
4|О©╫О©╫О©╫О©╫О©╫О©╫О©╫|4|"5 days"|15|4|A
5|О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫|1|"5 days"|15|5|A
\.
This work fine, and I have never experienced any problem with "foreign"
letters.
Oleg.
----
Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/
Programmers don't die, they just GOSUB without RETURN.