I want regtrigger alias

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:

  1. function doesn’t accept trigger name, but trigger oid only;
  2. 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.

Advertisements

2 thoughts on “I want regtrigger alias

  1. 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 😉

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s