title: Is it a good thing to Raise Exceptions intentionally in PostgreSQL?
body: <p>I am developing a PL function in Postgres, and in it I am modifying records of a table, according to some logic, then I execute a final query (basically counting), and if the number I get is positive, I throw an exception to rollback the transaction (since PostgreSQL's function doesn't support transactions explicitly).</p>
  
  <p>So is this a good method to emulate transactions? Do you have better suggestions ?</p>
  
  <p>PS: I am using PostgreSQL 9.2 but I am migrating to 9.3 soon, if this may help somehow.</p>