Postgresql – How to show the content of a trigger with psql

postgresqlpsql

I know I can list the triggers with \dft. But how can I see one concrete trigger? I want to know details like on which events the trigger is executed, which function is executed and so on.

Best Answer

OK, I found out about it myself.

The command \dft doesn't show the triggers itself (as I thought), it shows all trigger-functions (return-type trigger).

To see the trigger you can make \dS <tablename>, it shows not only columns of this table, but also all triggers defined on this table.

To show the source of the trigger-function (or any function) use \df+ <functionname>.