Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing records from PostgreSQL to MySQL

Was wondering if anyone had any insight or recommended tools for exporting the records from a PostgreSQL database and importing them into a MySQL database. I believe the table structure is 100% identical.

Thoughts? Thanks!

like image 624
Joseph Avatar asked Apr 20 '11 21:04

Joseph


2 Answers

The command

pg_dump --data-only --column-inserts <database_name>  

will generate SQL-standard-compliant INSERT statements with all column names listed and one VALUES clause per INSERT. This is the most portable way of moving data from PostgreSQL to any other SQL database.

like image 141
Matthew Wood Avatar answered Oct 19 '22 07:10

Matthew Wood


Check out SquirrelSQL, it can pump data from one database brand into another via the DBCopy plugin. When the table structures are really identical it works quite well.

like image 30
fvu Avatar answered Oct 19 '22 08:10

fvu