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

Re: Migrating Data from MySQL to PostgreSQL

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pdxpug(at)postgresql(dot)org
Subject: Re: Migrating Data from MySQL to PostgreSQL
Date: 2011-05-06 00:08:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pdxpug
On Thu, 5 May 2011, Lacey L. Powers wrote:

> In all of the times where I've migrated data from MySQL to PostgreSQL,
> this is all I have needed, for example:
> COPY table (col1,col2,col3,col4) FROM stdin;


   The data are not coming from stdin but from files on the disk.

   I have at the bottom of the DDL file lines such as these:

COPY comments FROM 'comments.csv' WITH DELIMITER '|';
COPY experts FROM 'experts.csv' WITH DELIMITER '|';

and the first couple of lines of comments.csv are:

7|J. D. Hardy|animal|1996-06-13 14:51:08|1996-06-17
8|J. D. Hardy|annelida|1996-06-13 14:51:08|1996-06-17

I could add WITH NULL AS "" to the commands.



In response to


pdxpug by date

Next:From: David E. WheelerDate: 2011-05-06 00:08:16
Subject: Re: Any Excel Experts
Previous:From: Tom KellerDate: 2011-05-06 00:06:54
Subject: Re: Any Excel Experts

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