title: Execute Trigger on View?
body: <p>I am not too familiar with database triggers and/or views.  I am currently using PostgreSQL and HSQL; although the database is not too important.  I am just wondering if <em>any</em> database offers something like this:</p>
  
  <p>I have an (example) table like this:</p>
  
  <pre><code>CREATE TABLE DUMMY_TABLE (ID INTEGER, NUMBER INTEGER);
  </code></pre>
  
  <p>I created a view like this:</p>
  
  <pre><code>CREATE VIEW DUMMY_VIEW AS SELECT * FROM DUMMY_TABLE WHERE NUMBER &gt; 5;
  </code></pre>
  
  <p>I insert a couple of entities:</p>
  
  <pre><code>INSERT INTO DUMMY_TABLE VALUES(1,2);
  INSERT INTO DUMMY_TABLE VALUES(1,10);
  </code></pre>
  
  <p>so of course the DUMMY_VIEW only contains VALUES(1,10) when I call</p>
  
  <pre><code>SELECT * FROM DUMMY_VIEW
  </code></pre>
  
  <p>So now what I want to do is add a trigger to the DUMMY_VIEW that is called whenever an entity is inserted that has NUMBER > 5.  </p>
  
  <p>I have tried adding triggers directly to the DUMMY_VIEW in both HSQL and PostgreSQL; but they say that triggers cannot be added to views.</p>
  
  <p>Is this (or a functionally similar solution) possible?</p>