title: PostgreSQL ERROR: function expression in FROM cannot refer to other relations of same query level
body: <p>I'm using postgreSQL to sort database. When I'm calling that query I have simple problem which I tried to solve for many ours, but it's still doesn't work.
  I'm trying to split one table to many different.</p>
  
  <pre><code>ALTER TABLE table
  ADD COLUMN nationality TEXT,
  ADD COLUMN place_of_birth TEXT,
  ADD COLUMN date_of_birth INTEGER,
  ADD COLUMN date_of_death INTEGER;
  
  -- perform update
  -- part which is not working
  
  WITH splitted_data AS (
  SELECT
    title,
    s [1] AS nationality,
    s [4] AS place_of_birth,
    s [5] AS date_of_birth,
    s [6] AS date_of_death,
    object_id
  FROM
    table,
    regexp_matches(table.artist_bio, '\(([^),]+),?\s?(born )?(([^\.]+)\.? )?(\d{4})?(\d{4})?\)') s
  )
  UPDATE table
  SET
    nationality = new_values.nationality,
    place_of_birth = new_values.place_of_birth,
    date_of_birth = new_values.date_of_birth :: INTEGER,
    date_of_death = new_values.date_of_death :: INTEGER
  FROM (
         SELECT
           nationality,
           place_of_birth,
           date_of_birth,
           date_of_death,
           object_id
         FROM splitted_data
       ) AS new_values
  WHERE table.object_id = new_values.object_id;
  
  --until here
  
  ALTER TABLE table
    DROP artist_bio;
  </code></pre>
  
  <p>Where:</p>
  
  <p>title is other column contains titles</p>
  
  <p>artist_bio is a VARCHAR contains information to be splitted</p>
  
  <p>Here is a little part of the table: <a href="http://wklej.org/hash/3a2f6f17d20/" rel="nofollow">http://wklej.org/hash/3a2f6f17d20/</a></p>
  
  <p>Thank you for any help! </p>