I'm looking for a way to log queries launched inside trigger procedures. after setting: log_statement = 'mod' in config i can see queries launched by application, but select's inserts and other queries launched inside trigger procedure are not available in log file. is there any way to show those queries
1 Answer
Try this http://www.postgresql.org/docs/current/static/pgstatstatements.html It creates a special table with all queries, the server executes.
You will need pg_stat_statements.track ('all').
If you need only to track the statements of the trigger consider setting pg_stat_statements.track ('none') and then pg_stat_statements.track ('all') right before the query that will call trigger. pg_stat_statements.track ('none') again after the trigger.