title: Insert/update/delete on Views Postgresql using Rules
body: <p>Whenever there is an insert/update/delete in my table, i want the same change to reflect in my view as well. Thinking of postgresql Rules?</p>
  
  <p>I have select Rules in place for the view. Want to write for the DML operations as well.</p>
  
  <p>Which one is the best example to follow.</p>
  
  <p>I was trying one for update</p>
  
  <pre><code>CREATE OR REPLACE RULE "v_incidents_upd" AS 
  ON UPDATE TO v_incidents
      DO INSTEAD
      UPDATE schema.incidents
         SET sl_name = NEW.sl_name,
             sl_avail = NEW.sl_avail,
             sl_color = NEW.sl_color,
             sl_len = NEW.sl_len,
             sl_unit = NEW.sl_unit
       WHERE sl_name = OLD.sl_name;
  </code></pre>