title: PostgreSQL 9.3: Migrate text column to macaddr type
body: <p>I have a table with a <strong>text column representing a MAC address</strong>, but I want to <strong>use the macaddr type instead</strong>. So, I tried:</p>
  
  <pre><code>alter table mytable alter column mac_column type macaddr;
  </code></pre>
  
  <p>And got this error</p>
  
  <pre><code>ERROR:  column "mac_column" cannot be cast automatically to type macaddr
  HINT:  Specify a USING expression to perform the conversion.
  </code></pre>
  
  <p>But I don't know what to use as USING expression:</p>
  
  <pre><code>alter table mytable alter column mac_column type macaddr using(????????)
  </code></pre>
  
  <p><strong>What should I use as USING expression?</strong></p>
  
  <p>Many thanks in advance</p>