I have ten tables and five triggers in my database. I don't know the trigger name, but I need to edit the trigger. So I need to know which table is called to which trigger? Using,
SELECT tgname
FROM pg_trigger;
we can print all the trigger name. But it did not show which table is called to which trigger. Can anyone explain to me?
The below query is used to get the information about trigger from informational_schema.
select * from information_schema.triggers;
The above command shows trigger_catalog, trigger_schema, trigger_name, event_manipulation, event_object_schema, event_object_table, action_statement, action_timing.
When we use the below command it shows only the "trigger name and table name".
test=> select trigger_name, event_object_table from information_schema.triggers;
trigger_name | event_object_table
-------------------------+--------------------
employees_trig1 | employees
emp_audit | emp_view
add_log_current_trigger | account_current
employees_trig2 | employees
emp_audit | emp_view
add_log_current_trigger | account_current
last_name_changes | employees
last_name_changes | employees
employees_trig1 | employees
emp_audit | emp_view
add_log_current_trigger | account_current
(11 rows)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With