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.
> 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
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;
<tab separated data goes here/>
Assuming all of your columns are of the correct types and size,
everything should load just fine from that file with a psql command:
psql -U postgres mydb -f data_file.copy
Hope that helps! =)
In response to
pdxpug by date
|Next:||From: Lacey L. Powers||Date: 2011-05-05 23:54:51|
|Subject: Re: Migrating Data from MySQL to PostgreSQL|
|Previous:||From: Rich Shepard||Date: 2011-05-05 23:35:52|
|Subject: Migrating Data from MySQL to PostgreSQL|