Interesting situation happened to me today. I wanted to know details of some trigger. The first thing that came to mind is to use pg_get_triggerdef function.
But here we have problems:
- function doesn’t accept trigger name, but trigger oid only;
- there is no any regtrigger stuff just like for relations, types, procs etc.
So I need to execute something like
SELECT pg_get_triggerdef(oid) FROM pg_trigger WHERE tgname = 'foo_trigger';
instead of something like
Not the big deal, one may think. But I want regtrigger stuff. 🙂
UPD: According to Marko’s comment, relation name included.