title: postgres: generate series of timestamps respecting time zone
body: <p>I'm stumped by a tricky issue regarding time zone changes from daylight savings to non daylight savings.</p>
  
  <p>I'm trying to generate a series of timestamps, 6 hrs apart. This is later joined with data with corresponding timestamps at the 00, 06, 12, 18 hrs for each day in the dataset.</p>
  
  <p>This works fine normally, using:</p>
  
  <p><code>generate_series(extract(epoch from start_ts)::integer, extract(epoch from end_ts)::integer, 21600)</code></p>
  
  <p>where start_ts is 00 hr on the first date, and end_ts is 00 hr on the last date exclusive.</p>
  
  <p>However, when timezone offset goes from +11 to +10 half way through the series, it will no longer match any records since the series elements become 1 hr off.</p>
  
  <p>Does anyone have suggestions on how to generate a series of 'epoch integers' or timestamps which would match 00,06,12,18 hr timestamps while respecting the timezone's offset?</p>