title: Convert a string representing a timestamp to an actual timestamp in PostgreSQL?
body: <p>In PostgreSQL: I convert <code>string</code> to <code>timestamp</code> with <code>to_timestamp()</code>:</p>
  
  <pre><code>select * from ms_secondaryhealthcarearea
  where to_timestamp((COALESCE(update_datetime, '19900101010101'),'YYYYMMDDHH24MISS') 
      &gt; to_timestamp('20121128191843','YYYYMMDDHH24MISS')
  </code></pre>
  
  <p>But I get this error: </p>
  
  <pre><code>ERROR:  syntax error at end of input
  LINE 1: ...H24MISS') &gt;to_timestamp('20121128191843','YYYYMMDDHH24MISS')
                                                                         ^
  ********** Error **********
  
  ERROR: syntax error at end of input
  SQL state: 42601
  Character: 176
  </code></pre>
  
  <p>Why? How to convert a <code>string</code> to <code>timestamp</code>?</p>