title: cross-database references are not implemented:
body: <p>I am trying to convert SQL inner join query into PostgreSQL inner join query. In this inner join query which tables are using that all tables are not present in one database. we separated tables into two databases i.e. application db and security db </p>
  
  <ol>
  <li>users and permission table are present in security db </li>
  <li>userrolemapping and department are present in application db</li>
  </ol>
  
  <p>I tried like below but I am getting following error</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>ERROR:  cross-database references are not implemented: "Rockefeller_ApplicationDb.public.userrolemapping"
  LINE 4:         INNER JOIN "Rockefeller_ApplicationDb".public.userro..
  </code></pre>
  
  <p><strong>SQL Stored Function</strong></p>
  
  <pre><code>SELECT   Department.nDeptID 
      FROM Users INNER JOIN Permission 
           ON Users.nUserID = Permission.nUserID INNER JOIN UserRoleMapping
           ON Users.nUserID = UserRoleMapping.nUserID INNER JOIN Department
           ON Permission.nDeptInst = Department.nInstID
           AND  Department.nInstID = 60
      WHERE     
           Users.nUserID = 3;
  </code></pre>
  
  <p><strong>PostgreSQL Stored Function</strong></p>
  
  <pre><code>SELECT dep.ndept_id 
          FROM "Rockefeller_SecurityDb".public.users as  u 
          INNER JOIN  "Rockefeller_SecurityDb".public.permissions p ON u.nuser_id = p.nuser_id
          INNER JOIN "Rockefeller_ApplicationDb".public.userrolemapping as urm ON u.nuser_id = urm.nuser_id
          INNER JOIN "Rockefeller_ApplicationDb".public.department dep ON p.ndept_inst = dep.ninst_id
             AND  dep.ninst_id = 60
                          WHERE     
                              u.nuser_id = 3;
  </code></pre>