How to run a cross database query using the postgres fdw extension.

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ม.ค. 2025

ความคิดเห็น • 5

  • @lukTheGamerLOL
    @lukTheGamerLOL หลายเดือนก่อน +1

    Hi im willing to do this for a School project. There is something i dont understand about this. Im using 2 databases with 2 ubuntu servers 22.04. The main one is holding a postgresl and the other one is holding a Mysql. Am i forced to use mysql_fdw? or postgres_fdw extension includes them? Thanks in advance

  • @KarakalLatino
    @KarakalLatino 2 หลายเดือนก่อน +1

    I have a question, which do you recommend, DBLink or fdw, for a large application with multiple large databases that connect to a global database on the same server from the same app?...thank you very much, subscribed to your channel, God bless you.

    • @BornToCode_YT
      @BornToCode_YT  2 หลายเดือนก่อน

      For simple queries that query the global db, I'd use DBLink, but if I'll need to save the DBLink query results as a view or write complex joins then I'd probably create foreign tables using fdw and only import the tables and columns I need. So if database 1 only needs the employees table from the global db then I'll just import that.
      Hope this helps.

  • @ahmadfikhri3736
    @ahmadfikhri3736 หลายเดือนก่อน

    This video is really helpful for someone new to postgres like me. But i have a question. Using your scenario, if there are more tables in database_2, i need to create foreign tables for all the tables there one by one?

    • @BornToCode_YT
      @BornToCode_YT  หลายเดือนก่อน

      Yes, that's correct