title: Convert hex in text representation to decimal number
body: <p>I am trying to convert hex to decimal using PostgreSQL 9.1</p>
  
  <p>with this query:</p>
  
  <pre><code>SELECT to_number('DEADBEEF', 'FMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>ERROR:  invalid input syntax for type numeric: " "
  </code></pre>
  
  <p>What am I doing wrong?</p>