title: Cancel previous operations in user defined function
body: <p>Is it possible to cancel previous operations in a user defined function?</p>
  
  <p>For example:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION transact_test () RETURNS BOOLEAN
  AS $$
      BEGIN
  
          UPDATE table1 SET ...
  
          UPDATE table2 SET ...
  
          IF some_condition THEN
              --Here is  possible to cancel  all above operations?
              RETURN FALSE; 
          END IF;
  
          RETURN TRUE;
      END;
  $$
  LANGUAGE plpgsql;
  </code></pre>