Is there any way to drop ALL triggers from ALL tables in Postgres? I know there’s a pg_trigger table I could look at, but it doesn’t look like it contains enough information for me to decipher which triggers I have added to my tables.
It also looks like Foreign Key constraints show up in the pg_trigger table, which I DO NOT want to drop. I just want to drop the user created trigger from my tables and keep the FKs.
Any suggestions?
Thanks, James.
The function from Drop ALL triggers from Postgres DB? strips only the occurrence from the first table and leaves the triggers with the same name in other tables. Here is the fixed function: