1

I have encountered a problem where I need to copy only data from a Postgresql database to Mysql database. I already have the Mysql database with empty tables. By using PGAdmin I got a backup (data only, without database schema). I tried using PSQL tool but it keeps giving segmentation fault which I couldn't fix at the moment. I am using Ubuntu. Any simple help with a guide will be highly appreciated to copy data.

1

4 Answers 4

2

Use postgres COPY, and MySQL LOAD DATA INFILE.

psql will crash because of out-of-memory if you try to display a few millions of rows because it fetches all the data beforehand to determine the column widths for a prettier display. If you intend to use psql to fetch lots of data, disable this.

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

1 Comment

Mysql wasn't ready at all for postgres' data format. It can't handle Ts or Fs for booleans, and is complaining about data truncation. Is there a set of args that need to be used with COPY for it to work with mysql?
1

You could try:

http://www.lightbox.ca/pg2mysql.php

1 Comment

That converts only DDL commands.There is no corresponding commands produced for psql Copy commands.
1

It looks like you might be trying to load data into mysql with the postgres client tool. Use the mysql client tools to manipulate data in the mysql server.

mysql client programs

Comments

-4

How can you move data into MySQL if you have errors reading from PSQL? Fix the error, then ask this question.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.