title: postgresql: how modify pg_catalog with a function?
body: <p>Hi I want create a function that creates a table in the pg_catalog like:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION foo() RETURNS void AS $$
  DECLARE
  
  BEGIN
  EXECUTE 'CREATE TABLE pg_catalog.tab(a integer)';   
          RETURN;
  
  END;
  $$ LANGUAGE plpgsql;
  </code></pre>
  
  <p>ERROR:  permission denied to create "pg_catalog.tab"<br>
  DETAIL:  System catalog modifications are currently disallowed.</p>
  
  <p><strong>I edit my question for add more detail:</strong></p>
  
  <p>Real I want create a function that start when a table was dropped. The only way that I think was to create a trigger on table pg_catalog.tables:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION a() RETURNS void AS $$
  DECLARE
  BEGIN
  
    EXECUTE 'CREATE TRIGGER "tt_drop" BEFORE DELETE ON pg_catalog.pg_tables EXECUTE PROCEDURE public.b()';
    RETURN;
  
  END;
  $$ LANGUAGE plpgsql;
  </code></pre>
  
  <p>and in the function b I want to do some operation on drop table before it was dropped...</p>