title: RETURNING rows using unnest()?
body: <p>I'm trying to return a set of rows after doing <code>UPDATE</code>.</p>
  
  <p>Something like this.</p>
  
  <pre><code>UPDATE Notis new_noti SET notis = '{}'::noti_record_type[] 
  FROM (SELECT * FROM Notis WHERE user_id = 2 FOR UPDATE) old_noti 
  WHERE old_noti.user_id = new_noti.user_id RETURNING unnest(old_noti.notis);
  </code></pre>
  
  <p>but postgres complains, rightly so:</p>
  
  <blockquote>
    <p>set-valued function called in context that cannot accept a set</p>
  </blockquote>
  
  <p>How am I supposed to go about implementing this? </p>
  
  <p>That is, <code>RETURNING</code> a set of rows from <code>SELECT</code>ed array after <code>UPDATE</code>?</p>
  
  <p>I'm aware that a function can achieve this using <code>RETURNS SETOF</code> but rather prefer not to if possible.</p>