Обсуждение: Problem with \copy
Hi there. I have some problems with importing a large txt db into postgres ... I try to use the \copy db from xyz to import from atabulator spaced textfile ... it takes 2-3sec then a "broken pipe" comes up and psql is beeing left .... anyone knows if there's a possibility to turn on something like "debugging mode" so that I get more infos than just "brokenpipe"? -- mit freundlichen Gruessen ===================================== Inside Electronic Online www.ieo.ch Eggenberger Marc me@ieo.ch Leimbachstr. 56 Tel 01/4802800 8041 Zuerich Fax 01/4802801 =====================================
On Mon, 28 Dec 1998, Marc Eggenberger wrote:
> Hi there.
>
> I have some problems with importing a large txt db into postgres ... I try to use the \copy db from xyz to import
froma tabulator spaced textfile ... it takes 2-3sec then a "broken pipe" comes up and psql is beeing left ....
> anyone knows if there's a possibility to turn on something like "debugging mode" so that I get more infos than just
"brokenpipe"?
Hallo Marc,
Is it possible you could have any ctrl chars in your data?
Any *apostrophes* that aren't escaped?
This may be completely off track but I've wasted god knows how much time
looking for other problems when I had forgotten to escape single quotes...
I use the following to `fix' user input when I get single quotes in char
strings: $usr_input =~ s/\'/s/\\'/g; If this is the problem you could use
sed to escape any single quotes in your dump file...HTH!
Viel erfolg,
Tom
> --
> mit freundlichen Gruessen
> =====================================
> Inside Electronic Online www.ieo.ch
> Eggenberger Marc me@ieo.ch
> Leimbachstr. 56 Tel 01/4802800
> 8041 Zuerich Fax 01/4802801
> =====================================
>
---------- Sisters of Charity Medical Center ----------
Department of Psychiatry
----
Thomas Good <tomg@q8.nrnet.org>
Coordinator, North Richmond C.M.H.C. Information Systems
75 Vanderbilt Ave, Quarters 8 Phone: 718-354-5528
Staten Island, NY 10304 Fax: 718-354-5056
If your data comes from a non-unix machine then you might have
carragereturn-linefeed pairs as newline delimiter. I would get a
broken-pipe in this situation. I wrote a perl script (on the unix
machine) to remove the carraige return ('\r') so that only the line
feed was left ('\n'). This solved my problem.
> I have some problems with importing a large txt db into postgres ... I try to use the \copy db from xyz to import
froma tabulator spaced textfile ... it takes 2-3sec then a "broken pipe" comes up and psql is beeing left ....
Regards,
Kenneth R. Mort <kenmort@mort.port.net>
TreeTop Research
Brooklyn, NY, USA