title: PostgreSql INSERT FROM SELECT RETURNING ID
body: <p>In PostgreSql 9.2.4 I have two tables: <code>user (id, login, password, name)</code> and <code>dealer (id, user_id)</code>.</p>
  
  <p>And I want to insert into both tables returning id of created dealer.</p>
  
  <p>Currently I'm doing it with two queries:</p>
  
  <pre><code>WITH rows AS (
      INSERT INTO "user"
          (login, password, name)
      VALUES
          ('dealer1', 'jygbjybk', 'Dealer 1')
      RETURNING id
  )
  INSERT INTO dealer (user_id)
      SELECT id
      FROM rows;
  SELECT currval('dealer_id_seq');
  </code></pre>
  
  <p>But can I implement this with a single <code>INSERT</code> query using <code>RETURNING</code> statement?</p>