pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Export tab delimited from mysql to postgres.
Date: Mon, 11 Oct 2004 08:59:40 +1000
Message-ID: <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net> (raw)


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; 

However when I use the below function to export as an insert statement, it
escapes all the CR/LF within each column. 

mysqldump --database mydatabase --password --user myusername --verbose
--complete-insert --tables users > myfile.sql 

Does anyone have any insigt into why the above select does not escape CR/LF
within varchar columns? 

I really want to get the export as tab delimited working to import into
postgres,which is much faster than insert statements. 

Theo



______________________________________________________________________
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.

view thread (9+ messages)  latest in thread

Message-ID: <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net>
Permalink:  ../82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net/
Also on:    postgresql.org/message-id/82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: Theo.Galanakis@lonelyplanet.com.au
  Subject: Re: Export tab delimited from mysql to postgres.
  In-Reply-To: <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net>
  References: <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.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