title: PostgreSQL: Update function return boolean
body: <p>Is the function below good?</p>
  
  <pre><code>CREATE FUNCTION password_set(bigint, char) RETURNS boolean AS $$
     UPDATE users SET password = $2 WHERE id = $1 RETURNING TRUE;
  $$ LANGUAGE SQL;
  </code></pre>
  
  <p>It returns <code>TRUE</code> when <code>UPDATE</code> sets <code>password</code> but <code>NULL</code> (instead of <code>FALSE</code>) when <code>UPDATE</code> doesn't set <code>password</code>.</p>
  
  <p>I think that will work for all intents and purposes, but do you think that's OK?</p>
  
  <p>If not, how would you change the function to return <code>FALSE</code> (instead of <code>NULL</code>) if the <code>UPDATE</code> doesn't set <code>password</code>?</p>