title: How can I ensure that a materialized view is always up to date?
body: <p>I'll need to invoke <code>REFRESH MATERIALIZED VIEW</code> on each change to the tables involved, right? I'm surprised to not find much discussion of this on the web.</p>
  
  <p>How should I go about doing this?</p>
  
  <p>I think the top half of the answer here is what I'm looking for: <a href="https://stackoverflow.com/a/23963969/168143">https://stackoverflow.com/a/23963969/168143</a></p>
  
  <p>Are there any dangers to this? If updating the view fails, will the transaction on the invoking update, insert, etc. be rolled back? (this is what I want... I think)</p>