Which trigger execute which function?

Поиск
Список
Период
Сортировка
Искать

Which trigger execute which function?

От:
"Raymond Chui" <Raymond.Chui@noaa.gov>
Дата:
Previous DBA create a lot of triggers and functions without
documentation like:

CREATE TRIGGER trigger_name [BEFORE | AFTER] event ON table_name
FOR EACH ROW EXECUTE PROCEDURE function_name();

Now he is gone. I couldn't find his PL/PGSQL source codes!

I can do

SELECT * FROM pg_proc;
SELECT * FROM pg_trigger;

to list all the name of triggers and functions. But I don't know which
trigger
execute which function. How do I find out that?

Our USENET new server (NNTP) doesn't have comp.databases.postgresql.*
news groups. Therefore, please cc: a copy to me if you reply.
Thank Q very much in advance!



Re: [GENERAL] Which trigger execute which function?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Raymond Chui"  writes:
> Previous DBA create a lot of triggers and functions without
> documentation like: ...
> Now he is gone. I couldn't find his PL/PGSQL source codes!

"pg_dump -s" is your friend.

			regards, tom lane

Re: Which trigger execute which function?

От:
Stephan Szabo <sszabo@megazone23.bigpanda.com>
Дата:
On Wed, 27 Feb 2002, Raymond Chui wrote:

> Previous DBA create a lot of triggers and functions without
> documentation like:
>
> CREATE TRIGGER trigger_name [BEFORE | AFTER] event ON table_name
> FOR EACH ROW EXECUTE PROCEDURE function_name();
>
> Now he is gone. I couldn't find his PL/PGSQL source codes!
>
> I can do
>
> SELECT * FROM pg_proc;
> SELECT * FROM pg_trigger;

select * from pg_trigger,pg_proc where tgfoid=pg_proc.oid;


Re: [GENERAL] Which trigger execute which function?

От:
Joe Conway <mail@joeconway.com>
Дата:
Raymond Chui wrote:
> Previous DBA create a lot of triggers and functions without
> documentation like:
> 
> CREATE TRIGGER trigger_name [BEFORE | AFTER] event ON table_name
> FOR EACH ROW EXECUTE PROCEDURE function_name();
> 
> Now he is gone. I couldn't find his PL/PGSQL source codes!
> 
> I can do
> 
> SELECT * FROM pg_proc;
> SELECT * FROM pg_trigger;
> 
> to list all the name of triggers and functions. But I don't know which
> trigger
> execute which function. How do I find out that?
> 
> Our USENET new server (NNTP) doesn't have comp.databases.postgresql.*
> news groups. Therefore, please cc: a copy to me if you reply.
> Thank Q very much in advance!
> 

You could use "pg_dump -s > mydb.dmp" to dump the database schema. Then 
open mydb.dmp in a text editor. I think this will show you all the 
details you need.

HTH,

Joe


FAQ