title: How is a Postgres "RAISE EXCEPTION" converted into a PDOException?
body: <p>I am trying to figure out which "parts" of "RAISE EXCEPTION" statement gets mapped into which "parts" of PDOException.  Can some one explain "who" and "how" perform this conversion (or better yet, point to document which describes this or source code which performs this)?</p>
  
  <p>More specifically, I would like to know if there is a way to affect SQLSTATUS value (in my tests its always 'P0001') and/or 'ERROR:' value (which is part of the message and is always empty)</p>
  
  <p>Best I could manage is:</p>
  
  <pre>
  RAISE EXCEPTION USING message = '&lt;a message>', ERRCODE = 'UE001'
  </pre>
  
  <p>which on PHP side gives me message like:</p>
  
  <pre>
  ERROR:  NUM:UE001, DETAILS:&lt;a message>
  </pre>
  
  <p>But I am not very happy with this. It would be great to be able to "put" 'UE001' into one of PDOException fields (so I do not have to parse it out of message string).</p>
  
  <p>You comments will be highly appreciated.</p>