Re: Export tab delimited from mysql to postgres.
От | Theo Galanakis |
---|---|
Тема | Re: Export tab delimited from mysql to postgres. |
Дата | |
Msg-id | 82E30406384FFB44AFD1012BAB230B5505F40D3E@shiva.au.lpint.net обсуждение исходный текст |
Ответ на | Export tab delimited from mysql to postgres. (Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>) |
Ответы |
Re: Export tab delimited from mysql to postgres.
(Bruno Wolff III <bruno@wolff.to>)
|
Список | pgsql-sql |
<p> <font size="2">Could you provide a example of how to do this?</font><p> <font size="2">I actually endedup exporting the data as Insert statements, which strips out cf/lf within varchars. However it takes an eternity toimport 200,000 records... 24 hours infact???? Is this normal?</font><p><font size="2">Theo</font><p><font size="2">-----OriginalMessage-----</font><br /><font size="2">From: Harald Fuchs [<a href="mailto:hf0722x@protecting.net">mailto:hf0722x@protecting.net</a>]</font><br /><font size="2">Sent: Monday, 11 October2004 7:34 PM</font><br /><font size="2">To: pgsql-sql@postgresql.org</font><br /><font size="2">Subject: Re: [SQL]Export tab delimited from mysql to postgres.</font><br /><p><font size="2">In article <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net>,</font><br/><font size="2">Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>writes:</font><p><font size="2">> Has anyone been able to export and importa tab delimited file from </font><br /><font size="2">> mysql to postgres successfully? This is my dilemma whichI have posted </font><br /><font size="2">> on mysql sites with no response, however postgres users may have come</font><br /><font size="2">> across the same issue:</font><p><font size="2">> Trying to export a tab delimitedfile with the following command, </font><br /><font size="2">> however it does not appear to strip out the CR/LFwithin a varchar </font><br /><font size="2">> column. select * into outfile '/tmp/users.txt' FIELDS ESCAPED BY '\\'</font><br /><font size="2">> LINES TERMINATED BY '\r\n' from users;</font><p><font size="2">It's a MySQL bug/misfeaturethat it doesn't translate CRs into '\r'. Nevertheless, you can import a MySQL tab delimited file into PostgreSQL- just pipe it through a small sed script.</font><br /><p><font size="2">---------------------------(end of broadcast)---------------------------</font><br/><font size="2">TIP 4: Don't 'kill -9' the postmaster</font><table><tr><tdbgcolor="#ffffff"><font color="#000000">______________________________________________________________________<br/>This email, including attachments,is intended only for the addressee<br />and may be confidential, privileged and subject to copyright. If you<br/>have received this email in error, please advise the sender and delete<br />it. If you are not the intended recipientof this email, you must not<br />use, copy or disclose its content to anyone. You must not copy or <br />communicateto others content that is confidential or subject to <br />copyright, unless you have the consent of the contentowner.<br /></font></td></tr></table>
В списке pgsql-sql по дате отправления: