0

Is it possible to log any one execution of sql transaction script as desired? I don't want to have logging turned on all the time as I only need information from the transaction to generate a profiler report via http://pgfouine.projects.postgresql.org/ ?!

Jeffrey04
  • 145
  • 1
  • 8

1 Answers1

1

Sure. before this transaction do:

set log_min_duration_statement=0;

do your things, and then reset it back to original value.

But. There is no point in profiling single transaction, unless it's several thousand commands long. Otherwise - you can just read the logs. But remember - timing based on single executed transactions are practically worthless.