Re: Export tab delimited from mysql to postgres. - Mailing list pgsql-sql

From Harald Fuchs
Subject Re: Export tab delimited from mysql to postgres.
Date
Msg-id pu4ql1mwe4.fsf@srv.protecting.net
Whole thread Raw
In response to Export tab delimited from mysql to postgres.  (Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>)
List pgsql-sql
In article <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net>,
Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au> 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.



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: SQL doubt - Date Add
Next
From: Gary Stainburn
Date:
Subject: table update using result from join