2

I'm looking to grab a few bits of data from musicbrainz db to use in a mysql based app.

I don't need the entire database, and have been looking at 'migrating' postgreSQL to mysql, which it seems lots of people have difficulty with.

Wouldn't it be simplest to just dump the postgreSQL data into a comma-delimited text file, and then import that into mysql?

I'm just getting started with this, and don't even have postgreSQL installed yet, but trying to look ahead at how I'm going to do it.

1
  • This really depends on the types of the columns in the tables you want. That is likely to be where the incompatibilities exist. Commented Aug 20, 2009 at 1:58

2 Answers 2

1

You can use COPY (in the psql client) to dump a single table.

Or you can use pg_dump with the -d parameter. This will cause pg_dump to dump INSERT statements, which you can just execute against your MySQL server. You will obviously need to port the schema first - and assuming the datatypes that are used exist in MySQL.

Sign up to request clarification or add additional context in comments.

Comments

0

Perhaps you want to dump you Database to a SQL script.

4 Comments

not really what I'm looking for. I know I can create an outfile from postgreSQL same as from mysql, but with all the talk about 'migrating' from one to the other, I'm wondering if this is for some reason not recommended. Seems like the easiest method to me.
Not sure I got your question, maybe cuz I don't know this "MusicBrainz". I'm reading the site right now... Looks like a public DB, is that it? Is there any reason why your app can't work with both local MySQL and remote MusicBrainz's PGSQL?
I'm only looking to get a subset of the data,not the entire thing. So I can dump that into a text file. It's a bit of a pain to create a PGSQL install just to do that, but seems like that might be where I'm at.
Maybe you want to build your own dumper which generate a SQL script for your specific case.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.