title: Postgres Sql Insertion using Begin Exception Block Error
body: <p>I am working query which uses begin exception block it gives me syntax error near insert here is my query</p>
  <pre><code>BEGIN
          INSERT INTO public.role(
          id, &quot;RoleName&quot;)
          VALUES (1, 'SomeRole')
          RETURNING id as roleid;
      
  EXCEPTION
      RETURNING -1 as roleid
  END
      
      select roleid
  </code></pre>