title: Cannot SELECT from UPDATE RETURNING clause in postgres
body: <p>I isolatet the problem from a much more complex query. Here the test scenario</p>
  
  <pre><code>DROP TABLE test; 
  CREATE TABLE test (
    id integer,
    description varchar(100)
  );
  
  INSERT INTO test(id, description) VALUES (1,'new'); 
  INSERT INTO test(id, description) VALUES (2,'new'); 
  </code></pre>
  
  <p>If I run the query:</p>
  
  <pre><code>SELECT * FROM test WHERE id IN (UPDATE test set description='test' RETURNING id)
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <p>ERROR:  syntax error at or near "test"
  LINE 1: SELECT * FROM test WHERE id (UPDATE test set description='test' RE...
                                              ^</p>
  
  <p><em><strong></em>***<em></strong> Fehler <strong></em>**<em>*</em></strong></p>
  
  <p>ERROR: syntax error at or near "test"
  SQL Status:42601
  Zeichen:37</p>
  
  <p>However if I only run the statemennt </p>
  
  <pre><code>UPDATE test set value='test' RETURNING id
  </code></pre>
  
  <p>I get a result with 2 rows:</p>
  
  <p>1
  2</p>
  
  <p>If I substitude that result I would have a query like:</p>
  
  <pre><code>SELECT * FROM test WHERE id IN (1,2);
  </code></pre>
  
  <p>with the result:</p>
  
  <p>1;"test"
  2;"test"</p>
  
  <p>Why do I not get the same result with my initial statement?</p>