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
SELECT pg_get_triggerdef('foo_table.foo_trigger'::regtrigger); |
Not the big deal, one may think. But I want regtrigger stuff. 🙂
UPD: According to Marko’s comment, relation name included.
Triggers are per-relation so the input syntax would also have to include the name of the relation. But I agree with you, you can never have too many reg* types 😉
LikeLike
Yeah, you’re absolutely right! Totally forgot this. 🙂
LikeLike