pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jerry Sievers <gsievers19@comcast.net>
To: Wells Oliver <wells.oliver@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Seeing where a given trigger function is in use?
Date: Fri, 14 Aug 2020 17:55:25 -0500
Message-ID: <87o8ncalcy.fsf@jsievers.enova.com> (raw)
In-Reply-To: <CAOC+FBU3mZyHvzfz=FE6QF=ACbEnVuzsTp6papj3epgCUWxL+g@mail.gmail.com>
References: <CAOC+FBU3mZyHvzfz=FE6QF=ACbEnVuzsTp6papj3epgCUWxL+g@mail.gmail.com>

Wells Oliver <wells.oliver@gmail.com> writes:

> Trying to track down every table that is using a certain trigger
> function, what's the best way to do that?

Have a look at the fields tgrelid and tgfoid in your pg_trigger catalog
where you will be enlightened :-)

For starters...

select tgrelid::regclass, tgfoid::regproc from pg_trigger;

Enjoy!

>
> --
> Wells Oliver
> wells.oliver@gmail.com
>
>

-- 
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net





view thread (2+ messages)

Message-ID: <87o8ncalcy.fsf@jsievers.enova.com>
Permalink:  ../87o8ncalcy.fsf@jsievers.enova.com/
Also on:    postgresql.org/message-id/87o8ncalcy.fsf@jsievers.enova.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gsievers19@comcast.net, wells.oliver@gmail.com
  Subject: Re: Seeing where a given trigger function is in use?
  In-Reply-To: <87o8ncalcy.fsf@jsievers.enova.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox