title: postgresql set timezone for materialized view
body: <p>ok - we've found a bug in one of our systems with materialized views refreshing to different data, depending on which system called the refresh.</p>
  <p>It turned out to be a problem with the client date settings - it depends on the timezone of the user.</p>
  <p>This is a big risk.  I know <em>per field</em> we can override settings - but it's tricky - because views consume other views, and date conversions/calculations are happpening anywhere in the view hierarchy - so there's no way we can guarantee client specific calculations won't get through.</p>
  <p>Is there any way we can embed something in the view definition that sets the current time zone for the whole view - so it doesn't matter who does the refresh, it will always produce the same result?</p>
  <p>I tried this - but it doesn't work :( - but want something like this:</p>
  <pre class="lang-sql prettyprint-override"><code>create materialized view blah as (
  set timezone to 'Australia/Brisbane';
  select now())
  </code></pre>