title: PostgreSQL 8.2: Require specific column to be present in UPDATE statement
body: <p>I would like to force user to specify origin of update to some table (sometbl),
  eg. to specify 'local' or 'remote' (for col2) - but checking of that requirement should occur at DB level when <code>UPDATE</code> statement is executed so:</p>
  
  <pre><code>UPDATE sometbl SET col1 = 'abc';
  </code></pre>
  
  <p>should throw error (exception), but:</p>
  
  <pre><code>UPDATE sometbl SET col1 = 'abc', col2 = 'remote';
  </code></pre>
  
  <p>...will succeed.</p>
  
  <p>I tried to create BEFORE update trigger for that table, but I was unable to check if 
  NEW.col2 was explictly set. </p>
  
  <p>I used condition</p>
  
  <pre><code>IF NEW.col2 IS NULL THEN 
     RAISE EXCEPTION 'you must specify source of this update (local/remote)'
  END IF;
  </code></pre>
  
  <p>but every time, when col2 was not specified in update (UPDATE sometbl SET col1 = 'abc')</p>
  
  <p>I got current value of that field in NEW.col2 pseudo-var, instead of supposed NULL.</p>
  
  <p>Is there any workaround to prevent UPDATING row when specified field is not present in UPDATE stmt?</p>