title: Insert into … values ( SELECT … FROM … ) in postgresql?
body: <p>I am working with <code>Postgresql</code> database. I have one database which is - <code>db1</code> and I have one table inside this database which is <code>App1</code>.</p>
  
  <p>I need to make a select query against this <code>App1</code> table which is in <code>db1</code> and then whatever results I am getting back, I need to insert them in <code>App2</code> table as it is which is in another database <code>db2</code>.</p>
  
  <p>Below is my query which I am running against <code>App1</code> table which is in <code>db1</code> - </p>
  
  <pre><code>select col1, col2 from App1 limit 5
  </code></pre>
  
  <p>Now is there any way I can use Insert statement along with above SELECT statement which can insert into App2 table for me automatically which is in <code>db2</code>?</p>
  
  <p>Something along this line -</p>
  
  <pre><code>Insert into … values ( SELECT … FROM … )
  </code></pre>
  
  <p>Is this possible to do in Postgresql as both the tables are in different database?  </p>