SELECT trigger_name, event_manipulation, event_object_schema, event_object_table,
action_order, action_condition, action_orientation, action_timing,
action_reference_old_table, action_reference_new_table
- FROM information_schema.triggers ORDER BY 1, 2;
+ FROM information_schema.triggers
+ WHERE event_object_table in ('pkeys', 'fkeys', 'fkeys2')
+ ORDER BY trigger_name COLLATE "C", 2;
trigger_name | event_manipulation | event_object_schema | event_object_table | action_order | action_condition | action_orientation | action_timing | action_reference_old_table | action_reference_new_table
----------------------------+--------------------+---------------------+--------------------+--------------+------------------+--------------------+---------------+----------------------------+----------------------------
check_fkeys2_fkey_restrict | DELETE | public | fkeys2 | 1 | | ROW | BEFORE | |
SELECT trigger_name, event_manipulation, event_object_schema, event_object_table,
action_order, action_condition, action_orientation, action_timing,
action_reference_old_table, action_reference_new_table
- FROM information_schema.triggers ORDER BY 1, 2;
+ FROM information_schema.triggers
+ WHERE event_object_table IN ('main_table')
+ ORDER BY trigger_name COLLATE "C", 2;
trigger_name | event_manipulation | event_object_schema | event_object_table | action_order | action_condition | action_orientation | action_timing | action_reference_old_table | action_reference_new_table
----------------------+--------------------+---------------------+--------------------+--------------+--------------------------------+--------------------+---------------+----------------------------+----------------------------
after_ins_stmt_trig | INSERT | public | main_table | 1 | | STATEMENT | AFTER | |
SELECT trigger_name, event_manipulation, event_object_schema, event_object_table,
action_order, action_condition, action_orientation, action_timing,
action_reference_old_table, action_reference_new_table
- FROM information_schema.triggers ORDER BY 1, 2;
- trigger_name | event_manipulation | event_object_schema | event_object_table | action_order | action_condition | action_orientation | action_timing | action_reference_old_table | action_reference_new_table
-------------------------+--------------------+---------------------+--------------------+--------------+------------------+--------------------+---------------+----------------------------+----------------------------
- after_ins_stmt_trig | INSERT | public | main_table | 1 | | STATEMENT | AFTER | |
- after_upd_a_b_row_trig | UPDATE | public | main_table | 1 | | ROW | AFTER | |
- after_upd_b_row_trig | UPDATE | public | main_table | 2 | | ROW | AFTER | |
- after_upd_b_stmt_trig | UPDATE | public | main_table | 1 | | STATEMENT | AFTER | |
- after_upd_stmt_trig | UPDATE | public | main_table | 2 | | STATEMENT | AFTER | |
- before_ins_stmt_trig | INSERT | public | main_table | 1 | | STATEMENT | BEFORE | |
- before_upd_a_stmt_trig | UPDATE | public | main_table | 1 | | STATEMENT | BEFORE | |
- child1_delete_trig | DELETE | public | child1 | 1 | | STATEMENT | AFTER | old_table |
- child1_insert_trig | INSERT | public | child1 | 1 | | STATEMENT | AFTER | | new_table
- child1_update_trig | UPDATE | public | child1 | 1 | | STATEMENT | AFTER | old_table | new_table
- child2_delete_trig | DELETE | public | child2 | 1 | | STATEMENT | AFTER | old_table |
- child2_insert_trig | INSERT | public | child2 | 1 | | STATEMENT | AFTER | | new_table
- child2_update_trig | UPDATE | public | child2 | 1 | | STATEMENT | AFTER | old_table | new_table
- child3_delete_trig | DELETE | public | child3 | 1 | | STATEMENT | AFTER | old_table |
- child3_insert_trig | INSERT | public | child3 | 1 | | STATEMENT | AFTER | | new_table
- child3_update_trig | UPDATE | public | child3 | 1 | | STATEMENT | AFTER | old_table | new_table
- parent_delete_trig | DELETE | public | parent | 1 | | STATEMENT | AFTER | old_table |
- parent_insert_trig | INSERT | public | parent | 1 | | STATEMENT | AFTER | | new_table
- parent_update_trig | UPDATE | public | parent | 1 | | STATEMENT | AFTER | old_table | new_table
-(19 rows)
+ FROM information_schema.triggers
+ WHERE event_object_table IN ('parent', 'child1', 'child2', 'child3')
+ ORDER BY trigger_name COLLATE "C", 2;
+ trigger_name | event_manipulation | event_object_schema | event_object_table | action_order | action_condition | action_orientation | action_timing | action_reference_old_table | action_reference_new_table
+--------------------+--------------------+---------------------+--------------------+--------------+------------------+--------------------+---------------+----------------------------+----------------------------
+ child1_delete_trig | DELETE | public | child1 | 1 | | STATEMENT | AFTER | old_table |
+ child1_insert_trig | INSERT | public | child1 | 1 | | STATEMENT | AFTER | | new_table
+ child1_update_trig | UPDATE | public | child1 | 1 | | STATEMENT | AFTER | old_table | new_table
+ child2_delete_trig | DELETE | public | child2 | 1 | | STATEMENT | AFTER | old_table |
+ child2_insert_trig | INSERT | public | child2 | 1 | | STATEMENT | AFTER | | new_table
+ child2_update_trig | UPDATE | public | child2 | 1 | | STATEMENT | AFTER | old_table | new_table
+ child3_delete_trig | DELETE | public | child3 | 1 | | STATEMENT | AFTER | old_table |
+ child3_insert_trig | INSERT | public | child3 | 1 | | STATEMENT | AFTER | | new_table
+ child3_update_trig | UPDATE | public | child3 | 1 | | STATEMENT | AFTER | old_table | new_table
+ parent_delete_trig | DELETE | public | parent | 1 | | STATEMENT | AFTER | old_table |
+ parent_insert_trig | INSERT | public | parent | 1 | | STATEMENT | AFTER | | new_table
+ parent_update_trig | UPDATE | public | parent | 1 | | STATEMENT | AFTER | old_table | new_table
+(12 rows)
-- insert directly into children sees respective child-format tuples
insert into child1 values ('AAA', 42);
SELECT trigger_name, event_manipulation, event_object_schema, event_object_table,
action_order, action_condition, action_orientation, action_timing,
action_reference_old_table, action_reference_new_table
- FROM information_schema.triggers ORDER BY 1, 2;
+ FROM information_schema.triggers
+ WHERE event_object_table in ('pkeys', 'fkeys', 'fkeys2')
+ ORDER BY trigger_name COLLATE "C", 2;
DROP TABLE pkeys;
DROP TABLE fkeys;
SELECT trigger_name, event_manipulation, event_object_schema, event_object_table,
action_order, action_condition, action_orientation, action_timing,
action_reference_old_table, action_reference_new_table
- FROM information_schema.triggers ORDER BY 1, 2;
+ FROM information_schema.triggers
+ WHERE event_object_table IN ('main_table')
+ ORDER BY trigger_name COLLATE "C", 2;
INSERT INTO main_table (a) VALUES (123), (456);
COPY main_table FROM stdin;
123 999
SELECT trigger_name, event_manipulation, event_object_schema, event_object_table,
action_order, action_condition, action_orientation, action_timing,
action_reference_old_table, action_reference_new_table
- FROM information_schema.triggers ORDER BY 1, 2;
+ FROM information_schema.triggers
+ WHERE event_object_table IN ('parent', 'child1', 'child2', 'child3')
+ ORDER BY trigger_name COLLATE "C", 2;
-- insert directly into children sees respective child-format tuples
insert into child1 values ('AAA', 42);