title: Select minimum value from each 1 hour block
body: <p>I have data: timestamp, value.</p>
  <pre><code>CREATE TABLE cgl
  (
      id integer NOT NULL DEFAULT nextval('cgl_id_seq'::regclass),
      ts integer,
      value integer
  )
  </code></pre>
  <p>I want to have minimum value from each 1 hour. There is unknown number of records per hour.
  I know more or less (rather less) I should use partition. Please point me to some examples or directions.</p>