Created
          November 14, 2012 00:24 
        
      - 
      
- 
        Save JerrySievert/4069347 to your computer and use it in GitHub Desktop. 
    trigger issue
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | DROP TABLE test_table CASCADE; | |
| CREATE TABLE test_table ( | |
| id SERIAL PRIMARY KEY, | |
| data VARCHAR | |
| ); | |
| CREATE TABLE test_table_part () INHERITS (test_table); | |
| CREATE OR REPLACE FUNCTION test_trigger_pre () RETURNS TRIGGER AS $$ | |
| BEGIN | |
| INSERT INTO test_table_part VALUES (NEW.*); | |
| RETURN NULL; | |
| END; | |
| $$ | |
| LANGUAGE 'plpgsql'; | |
| CREATE TRIGGER test_partitioner BEFORE INSERT ON test_table FOR EACH ROW EXECUTE PROCEDURE test_trigger_pre(); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment