Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have several sql statements running in some of my plpgsql triggers. I've enabled logging with the log_statement = 'all'. It logs the 'triggering statement', but not the statements within the query itself.

Is there a way to display statements that were executed within trigger in standard postgres log?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

The auto_explain module has auto_explain.log_nested_statements since at least 8.4, so that's one option. It's a bit heavyweight but I'm not aware of any other logging option that will record statements run inside PL/PgSQL functions and triggers.

See this similar question.

share|improve this answer
    
Thanks for the answer. This is exactly what I needed. –  Milovan Zogovic Mar 22 '13 at 13:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.