title: INSERT INTO ... SELECT with more SELECT columns
body: <h1>Thank you for your time.</h1>
  
  <p>I have a INSERT INTO ... SELECT setup, but I also want to filter using extra columns (that do not exist in the table I am inserting into)</p>
  
  <p>For example:</p>
  
  <pre><code>INSERT INTO table1 (t1_col1, t1_col2, t1_col3)
  SELECT
    t2.t1_col1,
    t2.t1_col2,
    t3.t1_col3,
    t4.filter_col
  FROM table2 t2
    INNER JOIN table3 t3 ON t2.t1_col1 = t3.t1_col1
    INNER JOIN table4 t4 ON t4.filter_col = t2.filer_col
  WHERE t4.filter_col = 'value';
  </code></pre>
  
  <p><strong>table1</strong> only has columns <em>t1_col1</em>, <em>t1_col2</em> and <em>t1_col3</em> so when I attempt to run this it fails as expected:</p>
  
  <pre><code>ERROR:  INSERT has more expressions than target columns
  </code></pre>
  
  <p>So my question is, how can I still include the filter, but specify which columns from my SELECT statement should be used in the INSERT INTO statement.</p>
  
  <p>Many thanks for any help!</p>