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 5A4ED329FBF for ; Mon, 11 Oct 2004 10:40:44 +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 41579-03 for ; Mon, 11 Oct 2004 09:40:33 +0000 (GMT) Received: from main.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id 360BC329F3B for ; Mon, 11 Oct 2004 10:40:34 +0100 (BST) Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CGwfS-0005kF-00 for ; Mon, 11 Oct 2004 11:40:34 +0200 Received: from srv.protecting.net ([212.126.218.242]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Oct 2004 11:40:34 +0200 Received: from hf0722x by srv.protecting.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Oct 2004 11:40:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Harald Fuchs Subject: Re: Export tab delimited from mysql to postgres. Date: 11 Oct 2004 11:33:55 +0200 Organization: Linux Private Site Lines: 16 Message-ID: References: <82E30406384FFB44AFD1012BAB230B5505F40D3A@shiva.au.lpint.net> Reply-To: hf0722x@protecting.net Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: srv.protecting.net User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/73 X-Sequence-Number: 19176 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.