title: Join tables in different Databases in AWS RDS Postgres Server
body: <p>I have 2 databases in one AWS RDS Postgres instance. I would like to join the tables across the databases. Is it possible to do that in AWS RDS ? </p>
  
  <p>What could be the walk around? </p>
  
  <p>I have created extension dblink.</p>
  
  <pre><code>CREATE EXTENSION dblink
  </code></pre>
  
  <p>And my join query is -</p>
  
  <pre><code>SELECT *                                                       
  FROM test tb1 
  LEFT JOIN (SELECT * FROM dblink('dbname=test_db','SELECT id, name FROM test') AS tb2(id, name)) AS tb2 ON tb2.id = tb1.id;
  </code></pre>
  
  <p>I get this error-</p>
  
  <pre><code>ERROR:  a column definition list is required for functions returning "record"
  LINE 3: LEFT JOIN (SELECT * FROM dblink('dbname=test_db','SELECT id,...
  </code></pre>
  
  <p>What could be the issue and fix ? </p>
  
  <p>Thanks</p>