X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 348EF32ABA7 for ; Tue, 12 Oct 2004 00:27:28 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02577-09 for ; Mon, 11 Oct 2004 23:27:16 +0000 (GMT) Received: from angel.lonelyplanet.com.au (mail.lonelyplanet.com.au [202.147.44.168]) by svr1.postgresql.org (Postfix) with ESMTP id 070CE32A435 for ; Tue, 12 Oct 2004 00:27:16 +0100 (BST) Received: from shiva.au.lpint.net ([192.168.61.22]) by angel with InterScan Messaging Security Suite; Tue, 12 Oct 2004 09:23:17 +1000 Received: by shiva.au.lpint.net with Internet Mail Service (5.5.2656.59) id <4VK6X3KA>; Tue, 12 Oct 2004 09:23:42 +1000 Message-ID: <82E30406384FFB44AFD1012BAB230B5505F40D3E@shiva.au.lpint.net> From: Theo Galanakis To: pgsql-sql@postgresql.org Subject: Re: Export tab delimited from mysql to postgres. Date: Tue, 12 Oct 2004 09:23:41 +1000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4AFE9.5852AAF0" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.6 tagged_above=0.0 required=5.0 tests=DNS_FROM_RFCI_DSN, EXCUSE_16, HTML_MESSAGE X-Spam-Level: * X-Archive-Number: 200410/76 X-Sequence-Number: 19179 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C4AFE9.5852AAF0 Content-Type: text/plain Could you provide a example of how to do this? I actually ended up exporting the data as Insert statements, which strips out cf/lf within varchars. However it takes an eternity to import 200,000 records... 24 hours infact???? Is this normal? Theo -----Original Message----- From: Harald Fuchs [mailto:hf0722x@protecting.net] Sent: Monday, 11 October 2004 7:34 PM To: pgsql-sql@postgresql.org Subject: Re: [SQL] Export tab delimited from mysql to postgres. In article <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net>, Theo Galanakis writes: > Has anyone been able to export and import a tab delimited file from > mysql to postgres successfully? This is my dilemma which I have posted > on mysql sites with no response, however postgres users may have come > across the same issue: > Trying to export a tab delimited file with the following command, > however it does not appear to strip out the CR/LF within a varchar > column. select * into outfile '/tmp/users.txt' FIELDS ESCAPED BY '\\' > LINES TERMINATED BY '\r\n' from users; It's a MySQL bug/misfeature that 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. ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster ______________________________________________________________________ This email, including attachments, is intended only for the addressee and may be confidential, privileged and subject to copyright. If you have received this email in error, please advise the sender and delete it. If you are not the intended recipient of this email, you must not use, copy or disclose its content to anyone. You must not copy or communicate to others content that is confidential or subject to copyright, unless you have the consent of the content owner. ------_=_NextPart_001_01C4AFE9.5852AAF0 Content-Type: text/html Content-Transfer-Encoding: quoted-printable RE: [SQL] Export tab delimited from mysql to postgres.

        Could you prov= ide a example of how to do this?

        I actually end= ed up exporting the data as Insert statements, which strips out cf/lf withi= n varchars. However it takes an eternity to import 200,000 records... 24 ho= urs infact???? Is this normal?

Theo

-----Original Message-----
From: Harald Fuchs [mailto:hf0722x@protecting.net]
Sent: Monday, 11 October 2004 7:34 PM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Export tab delimited from mysql to po= stgres.


In article <82E30406384FFB44AFD1012BAB230B5505F40D3A@s= hiva.au.lpint.net>,
Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>= ; writes:

> Has anyone been able to export and import a tab deli= mited file from
> mysql to postgres successfully? This is my dilemma = which I have posted
> on mysql sites with no response, however postgres u= sers may have come
> across the same issue:

> Trying to export a tab delimited file with the follo= wing command,
> however it does not appear to strip out the CR/LF w= ithin a varchar
> column. select * into outfile '/tmp/users.txt' FIEL= DS ESCAPED BY '\\'
> LINES TERMINATED BY '\r\n' from users;

It's a MySQL bug/misfeature that it doesn't translate CRs= into '\r'. Nevertheless, you can import a MySQL tab delimited file into Po= stgreSQL - just pipe it through a small sed script.


---------------------------(end of broadcast)------------= ---------------
TIP 4: Don't 'kill -9' the postmaster

____________________= __________________________________________________
This email, including= attachments, is intended only for the addressee
and may be confidential= , privileged and subject to copyright. If you
have received this email = in error, please advise the sender and delete
it. If you are not the in= tended recipient of this email, you must not
use, copy or disclose its c= ontent to anyone. You must not copy or
communicate to others content t= hat is confidential or subject to
copyright, unless you have the consen= t of the content owner.
= ------_=_NextPart_001_01C4AFE9.5852AAF0--