title: raise notice '% %', SQLERRM, SQLSTATE not working
body: <p>I have problem to raise notice when exception occurs.
  Lets say that my query has two inserts statements.</p>
  
  <pre><code>      do $$       
        begin
          insert into ...
          insert into ...
        exception when others then 
          raise notice '% %', SQLERRM, SQLSTATE;
        end; $$ 
        language 'plpgsql';
  </code></pre>
  
  <p>I want to return error message and code.
  Currently nothing happen. IF I remove 'notice '% %', SQLERRM, SQLSTATE;'
  then error is raised but I need to catch it. Seems that 'notice' does not work.
  This is what I have got in response</p>
  
  <pre><code>{"command":"BEGIN","rowCount":null,"oid":null,"rows":[],"fields":[],"_parsers":[],"RowCtor":null,"rowAsArray":true}
  {"command":"LOCK","rowCount":null,"oid":null,"rows":[],"fields":[],"_parsers":[],"RowCtor":null,"rowAsArray":true}
  {"command":"DO","rowCount":null,"oid":null,"rows":[],"fields":[],"_parsers":[],"RowCtor":null,"rowAsArray":true}
  {"command":"COMMIT","rowCount":null,"oid":null,"rows":[],"fields":[],"_parsers":[],"RowCtor":null,"rowAsArray":true}
  </code></pre>
  
  <p>Postgres 9.4</p>