title: Resample on time series data
body: <p>I have a table with time series column in the millisecond, I want to resample the time series and apply mean on the group. How can I implement it in Postgres?</p>
  
  <p>"Resample" means aggregate all time stamps within one second or one minute. All rows within one second or one minute form a group.</p>
  
  <p>table structure</p>
  
  <pre><code>date    x    y    z
  </code></pre>