title: String to timestamp in Postgresql
body: <h1>Problem</h1>
  
  <p>How do you convert a string to a timestamp?</p>
  
  <p>The <a href="https://www.postgresql.org/docs/current/functions-formatting.html" rel="nofollow noreferrer">documentation</a> and all answers that I have found show how to convert at string column to timestamp with the to_timestamp function, but this apparently does not work for a single string.</p>
  
  <h1>What I have tried</h1>
  
  <pre><code>to_timestamp('2019-09-20 13:59', 'DD-MM-YYYY HH24:MI:SS')
  
  Cast('2019-09-20 13:59' as timestamp)
  </code></pre>
  
  <h1>What I want to do</h1>
  
  <p>I want to add a column to a table with this date as a repeated value.</p>
  
  <pre><code>-- Creating timestamp column
  ALTER TABLE my_table ADD creation_date timestamp
  
  -- Repeating timestamp 
  UPDATE my_table  SET creation_date = TO_TIMESTAMP('2019-09-20 13:59', 'YYYY-MM-DD HH24:MI')
  </code></pre>