Rodrigo Luz
Rodrigo Luz

Reputation: 23

Is it possible to make a join between tables that are in different databases?

I have two databases, one is oracle and the other one is postgres, and I need to perform a join select between tables in those databases. Is there any way to make this possible?

Upvotes: 2

Views: 424

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246493

That is simple.

Install oracle_fdw in the PostgreSQL database and define a foreign table for the Oracle table.

Then you can perform the join as if it were two PostgreSQL tables.

Be careful with big or complicated queries though: of course, the performance will be worse than for a join of two local tables.

Upvotes: 2

Related Questions