Skip site navigation (1) Skip section navigation (2)

Re: Migrating Data from MySQL to PostgreSQL

From: "Lacey L(dot) Powers" <lacey(dot)leanne(at)gmail(dot)com>
To: pdxpug(at)postgresql(dot)org
Subject: Re: Migrating Data from MySQL to PostgreSQL
Date: 2011-05-05 23:54:51
Message-ID: 4DC338CB.7020207@gmail.com (view raw or flat)
Thread:
Lists: pdxpug
On 05/05/2011 04:35 PM, Rich Shepard wrote:
>   There is an interesting database we need for a project that is
> downloadable as the equivalent of postgres' pg_dumpall. The file contains
> the DDL for the tables and supporting features and there are 19 separate
> files containing the data with the pipe symbol separating attributes. 
> Before
> I upset psql I want to check my thinking with you experts.
>
>   I modified the DDL statements to remove the apparently 
> MySQL-specific calls
> to a database engine, and I modified the data load statements to use the
> postgres copy command.
>
>   My question is whether I need to prepend a slash to the copy command 
> as I
> would when running it from the command line.
>
>   I'll be happy to provide samples and further information if that's
> desired.
>
> Rich
>

One other small thing to add. For NULLs you might want to add FROM stdin 
WITH NULL AS '' to the end of the command.

=)

Lacey

In response to

pdxpug by date

Next:From: Tom KellerDate: 2011-05-06 00:06:54
Subject: Re: Any Excel Experts
Previous:From: Lacey L. PowersDate: 2011-05-05 23:48:25
Subject: Re: Migrating Data from MySQL to PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group