title: pl/pgsql Return true if update was successful
body: <p>Given the following skeleton pl/pgsql function, how can I make it return <code>true</code> if the update was successful (something was actually updated) and false otherwise?</p>
  
  <pre><code>CREATE FUNCTION UpdateThingy(
      /* input parameters */
  ) RETURNS BOOLEAN AS $$
  BEGIN
      UPDATE thingies SET /* blah blah */ WHERE /* blah blah */;
      RETURN true;
  END;
  $$ LANGUAGE plpgsql;
  </code></pre>
  
  <p>Currently this will always return <code>true</code>, even if no rows where updated. I want to return <code>false</code> in the case of no rows being affected by the update.</p>