|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.367 2003/09/29 00:05:25 petere Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.368 2003/09/29 18:50:58 momjian Exp $ |
12 | 12 | *
|
13 | 13 | * NOTES
|
14 | 14 | * this is the "main" module of the postgres backend and
|
@@ -955,25 +955,17 @@ exec_simple_query(const char *query_string)
|
955 | 955 | usecs = (long) (stop_t.tv_sec - start_t.tv_sec) * 1000000 + (long) (stop_t.tv_usec - start_t.tv_usec);
|
956 | 956 |
|
957 | 957 | /*
|
958 |
| - * Output a duration_query to the log if the query has exceeded |
959 |
| - * the min duration. |
| 958 | + * Output a duration_statement to the log if the query has exceeded |
| 959 | + * the min duration, or if we are to print all durations. |
960 | 960 | */
|
961 |
| - if (usecs >= save_log_min_duration_statement * 1000) |
| 961 | + if (save_log_duration || |
| 962 | + (save_log_min_duration_statement > 0 && |
| 963 | + usecs >= save_log_min_duration_statement * 1000)) |
962 | 964 | ereport(LOG,
|
963 |
| - (errmsg("duration_statement: %ld.%06ld %s", |
| 965 | + (errmsg("duration: %ld.%06ld %s", |
964 | 966 | (long) (stop_t.tv_sec - start_t.tv_sec),
|
965 | 967 | (long) (stop_t.tv_usec - start_t.tv_usec),
|
966 | 968 | query_string)));
|
967 |
| - |
968 |
| - /* |
969 |
| - * If the user is requesting logging of all durations, then log |
970 |
| - * that as well. |
971 |
| - */ |
972 |
| - if (save_log_duration) |
973 |
| - ereport(LOG, |
974 |
| - (errmsg("duration: %ld.%06ld sec", |
975 |
| - (long) (stop_t.tv_sec - start_t.tv_sec), |
976 |
| - (long) (stop_t.tv_usec - start_t.tv_usec)))); |
977 | 969 | }
|
978 | 970 |
|
979 | 971 | if (save_log_statement_stats)
|
@@ -2662,7 +2654,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
2662 | 2654 | if (!IsUnderPostmaster)
|
2663 | 2655 | {
|
2664 | 2656 | puts("\nPOSTGRES backend interactive interface ");
|
2665 |
| - puts("$Revision: 1.367 $ $Date: 2003/09/29 00:05:25 $\n"); |
| 2657 | + puts("$Revision: 1.368 $ $Date: 2003/09/29 18:50:58 $\n"); |
2666 | 2658 | }
|
2667 | 2659 |
|
2668 | 2660 | /*
|
|
0 commit comments