title: Padding zeros to the left in postgreSQL
body: <p>I am relatively new to PostgreSQL and I know how to pad a number with zeros to the left in SQL Server but I'm struggling to figure this out in PostgreSQL.</p>
  
  <p>I have a number column where the maximum number of digits is 3 and the min is 1: if it's one digit it has two zeros to the left, and if it's 2 digits it has 1, e.g. 001, 058, 123.</p>
  
  <p>In SQL Server I can use the following:</p>
  
  <pre><code>RIGHT('000' + cast([Column1] as varchar(3)), 3) as [Column2]
  </code></pre>
  
  <p>This does not exist in PostgreSQL. Any help would be appreciated.</p>