title: PostgreSQL: Creating a Trigger that tries to do work on a non existing table
body: <p>as we start to migrate our Application from using Oracle to PostgreSQL we ran into the following problem:</p>
  
  <p>A lot of our Oracle scripts create triggers that work on Oracle specific tables which dont exist in PostgreSQL. When running these scripts on the PG database they will not throw an error. 
  Only when the trigger is triggered an error is thrown.</p>
  
  <p>Example code:</p>
  
  <pre><code>-- Invalid query under PostgreSQL
  select * from v$mystat;
  
  -- Create a view with the invalid query does not work (as expected)
  create or replace view Invalid_View as 
  select * from v$mystat;
  
  -- Create a test table
  create table aaa_test_table (test timestamp);
  
  -- Create a trigger with the invalid query does(!) work (not as expected)
  create or replace trigger Invalid_Trigger 
  before insert 
  on aaa_test_table
  begin
      select * from v$mystat;
  end;
  
  -- Insert fails if the trigger exists                                    
  insert into aaa_test_table (test) values(sysdate);
  
  -- Select from the test table
  select * from aaa_test_table 
  order by test desc;
  </code></pre>
  
  <p>Is there a way to change this behavior to throw an error on trigger creation instead?</p>
  
  <p>Kind Regards,
  Hammerfels</p>
  
  <p>Edit:</p>
  
  <p>I was made aware, that we actually dont use basic PostgreSQL but EDB instead.
  That would probably explain why the syntax for create trigger seems wrong.
  I'm sorry for the confusion.</p>