Reputation: 97
I want to get postgres to log the execution duration of its queries, in either a custom log format or the csvlog format
But I can't find anywhere in the documentation which % tag corresponds to the duration in a custom log format, or which csv column contains the duration.
Where do I find that ?
Upvotes: 0
Views: 1191
Reputation: 247625
The duration of the statement is not a tag in log_line_prefix
. It is part of the log message if you set log_min_duration_statement = 0
, which will log all statements and their duration.
Upvotes: 1
Reputation: 1528
I think you are looking for log duration it is not a % tag as it will be logged in a different line when the query completes. You'll have to make the association between that line and the query using the tags that you logged.
Upvotes: 1