0

I have table A (MySQL) and table B (PostgreSQL)

I want to include all existing records in table A to table B

Could this be done?

Thank you

Mi-Creativity
  • 9,554
  • 10
  • 38
  • 47
moses toh
  • 12,344
  • 71
  • 243
  • 443
  • I assume you're using to different DB-systems. Try to export the data to a common format (e.g. XML), which you can import into the destination table. – Jannik Dec 21 '15 at 07:09

2 Answers2

0

I used MYSQL work bench (https://www.mysql.com/products/workbench/) for migration of MS SQL to Mysql. The schema got converted but that data didn't get transferred. Probably because my database size was 1.5GB. I would recommend you to give it a try and I am sure that will work in your case. It shows the detailed logs in case of failure and pretty robust.

Danyal Sandeelo
  • 12,196
  • 10
  • 47
  • 78
0

Export table into csv

http://www.mysqltutorial.org/mysql-export-table-to-csv/

and then import it into postgresql

How to import CSV file data into a PostgreSQL table?

e.g.

SELECT * FROM A
INTO OUTFILE 'C:/tmp/data.csv'
FIELDS ENCLOSED BY '"' TERMINATED BY ',' ESCAPED BY '"'
LINES TERMINATED BY '\r\n';


// must be same column as csv file
create table B  (....)

COPY B(column_1, column_2, . . . . ) FROM 'C:/tmp/data.csv' DELIMITER ',' CSV;

if you are using pgadmin3 then simple follow this answer to import csv file into postgresql

How should I import data from CSV into a Postgres table using pgAdmin 3?

Community
  • 1
  • 1
Shubham Batra
  • 2,357
  • 5
  • 29
  • 48