title: INSERT multiple rows from SELECT in Postgresql
body: <p>As described in the PostgreSQL <a href="http://www.postgresql.org/docs/9.4/static/sql-insert.html" rel="noreferrer">manual</a> one can add multiple rows in a single <code>INSERT</code> statement:</p>
  
  <pre><code>INSERT INTO films (code, title, did, date_prod, kind) VALUES
      ('6717', 'Tampopo', 110, '1985-02-10', 'Comedy'),
      ('6120', 'The Dinner Game', 140, DEFAULT, 'Comedy');
  </code></pre>
  
  <p>Also a nested <code>SELECT</code> query like this works:</p>
  
  <pre><code>INSERT INTO films (code, title, did, date_prod, kind)
       SELECT table.code, 'Tampopo', 110, '1985-02-10', 'Comedy'
       FROM other_table AS table2;
  </code></pre>
  
  <p>However, I can't seem to figure out a way to do both at the same time:</p>
  
  <pre><code>INSERT INTO films (code, title, did, date_prod, kind) 
  SELECT
      (table.code + 100, 'abc', NULL, t2.date_prod, t2.kind),
      (table.code + 200, 'xyz', NULL, t2.date_prod, t2.kind)
  FROM other_table AS t2;
  </code></pre>
  
  <p>If <code>other_table</code> contained only <code>(61717 | 'Tampopo' | NULL | '1985-02-10' | 'Comedy')</code>, the result table would look like this:</p>
  
  <pre><code> code | title |  did |   date_prod  |   kind
  --------------------------------------------------
  61817 | 'abc' | NULL | '1985-02-10' | 'Comedy'
  61917 | 'xyz' | NULL | '1985-02-10' | 'Comedy'
  </code></pre>
  
  <p><a href="http://sqlfiddle.com/#!15/4884e/3/0" rel="noreferrer">This fiddle</a> should explain it further...</p>
  
  <p>Could you please point me to where I am going wrong. If possible, I would like to avoid multiple lookups in <code>other_table AS t2</code> because it is a <code>VIEW</code> and it takes considerable time to construct.</p>