Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way join tables of MySql and PostgreSQL?

I have a table in MySql in one server and a table in PostgreSQL in another server. I want use use JOIN operation with those tables. Is there any way to join the columns? If not, is there any way to print the rows in same order? Please help!!

like image 429
Chittaranjan Das Avatar asked Oct 15 '25 15:10

Chittaranjan Das


2 Answers

Use mysql_fdw to define the MySQL table as a foreign table in PostgreSQL. Then you can join it with the PostgreSQL table in PostgreSQL.

like image 113
Laurenz Albe Avatar answered Oct 18 '25 07:10

Laurenz Albe


You can use Materialize to achieve this.

Here is a sample demo project that you can run to see this in action:

enter image description here

You can find the code for the demo project and how to run it on GitHub here:

https://github.com/bobbyiliev/materialize-tutorials/tree/main/mz-join-mysql-and-postgresql

like image 25
Bobby Iliev Avatar answered Oct 18 '25 08:10

Bobby Iliev