Postgresql to_number() function format
<p>I want to use postgresql <code>to_number(numberString, format_mask)</code>. My numberString may contain leading zeros (I don't know the actual length of these zeros and the numberString in total). I want to trim these zeros and get the value as number.</p>

<p>I've read about this function <a href="http://www.techonthenet.com/postgresql/functions/to_number.php" rel="nofollow">here</a> and currently using the format:</p>

<pre><code>select to_number('00005469', '9999999999')
</code></pre>

<p>But if the length of '9's is less than the length of the numberString then I can't get the correct number. How can I make this work without writing a long list of '9' in format_mask?</p>