Skip to content

Commit a4f14fd

Browse files
committed
Fix display of log duration so it is milliseconds.microseconds "ms".
Greg Sabino Mullane
1 parent 0bf9d3a commit a4f14fd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/backend/tcop/postgres.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.496 2006/08/08 01:23:15 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.497 2006/08/10 00:44:01 momjian Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1094,11 +1094,11 @@ exec_simple_query(const char *query_string)
10941094
if (was_logged)
10951095
ereport(LOG,
10961096
(errmsg("duration: %ld.%03d ms",
1097-
secs, msecs)));
1097+
secs * 1000 + msecs, usecs % 1000)));
10981098
else
10991099
ereport(LOG,
11001100
(errmsg("duration: %ld.%03d ms statement: %s%s",
1101-
secs, msecs,
1101+
secs * 1000 + msecs, usecs % 1000,
11021102
query_string,
11031103
prepare_string ? prepare_string : "")));
11041104
}
@@ -1855,11 +1855,11 @@ exec_execute_message(const char *portal_name, long max_rows)
18551855
if (log_statement == LOGSTMT_ALL) /* already logged? */
18561856
ereport(LOG,
18571857
(errmsg("duration: %ld.%03d ms",
1858-
secs, msecs)));
1858+
secs * 1000 + msecs, usecs % 1000)));
18591859
else
18601860
ereport(LOG,
18611861
(errmsg("duration: %ld.%03d ms execute %s%s%s%s: %s",
1862-
secs, msecs,
1862+
secs * 1000 + msecs, usecs % 1000,
18631863
execute_is_fetch ? "fetch from " : "",
18641864
portal->prepStmtName ? portal->prepStmtName : "<unnamed>",
18651865
*portal->name ? "/" : "",

0 commit comments

Comments
 (0)