From: Harald Fuchs <hf0722x@protecting.net>
To: pgsql-sql@postgresql.org
Subject: Re: Export tab delimited from mysql to postgres.
Date: 11 Oct 2004 11:33:55 +0200
Message-ID: <pu4ql1mwe4.fsf@srv.protecting.net> (raw)
References: <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: hf0722x@protecting.net
Subject: Re: Export tab delimited from mysql to postgres.
In-Reply-To: <pu4ql1mwe4.fsf@srv.protecting.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox