title: When inserting timestamp to a table it inserts as date - Redshift
body: <p>I have <code>table1</code> with data on it and in every row there is <code>&quot;period_start&quot;</code> and <code>&quot;period_end&quot;</code>, both columns are <code>dates</code>. Ex: '2021-06-30'.</p>
  <p>I have a <code>table2</code> I created with 2 columns of the same name, this time they are saved as <code>timestamp</code> (client wants as timestamp).</p>
  <p>I ran a query that inserts the results of <code>table1</code> to <code>table2</code> but converts the date columns to timestamp. For some reason I couldn't understand, the results in <code>table2</code> are all dates and not as timestamp.</p>
  <p>Creating <code>table2</code> (removed other columns):</p>
  <pre><code>CREATE TABLE IF NOT EXISTS table2
  (
      ,period_start timestamp   ENCODE zstd
      ,period_end timestamp   ENCODE zstd
  )
  </code></pre>
  <p>Inserting from <code>table1</code>:</p>
  <pre><code>insert into table2 (period_start ,period_end)
  select 
      cast(to_date(period_start,'YYYY-MM-DD HH24:MI:SS') as timestamp), 
      cast(DATEADD(millisecond, -1,last_day(period_start + 75) + 1) as timestamp)
  from table1;
  </code></pre>
  <p>When running the same select I see the results as timestamp perfectly, when querying from <code>table2</code> the results are saved as date.</p>