From 61c3e5b2486825ee65da322e1408286a8c0d5de6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 2 Mar 2007 23:37:23 +0000 Subject: Make log_min_error_statement put LOG level at the same priority as log_min_messages does; and arrange to suppress the duplicative output that would otherwise result from log_statement and log_duration messages. Bruce Momjian and Tom Lane. --- src/backend/tcop/postgres.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 1c40a8752e9..afb6b4db0a1 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.525 2007/02/20 17:32:16 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.526 2007/03/02 23:37:22 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -823,6 +823,7 @@ exec_simple_query(const char *query_string) { ereport(LOG, (errmsg("statement: %s", query_string), + errhidestmt(true), errdetail_execute(parsetree_list))); was_logged = true; } @@ -1020,12 +1021,14 @@ exec_simple_query(const char *query_string) { case 1: ereport(LOG, - (errmsg("duration: %s ms", msec_str))); + (errmsg("duration: %s ms", msec_str), + errhidestmt(true))); break; case 2: ereport(LOG, (errmsg("duration: %s ms statement: %s", msec_str, query_string), + errhidestmt(true), errdetail_execute(parsetree_list))); break; } @@ -1281,14 +1284,16 @@ exec_parse_message(const char *query_string, /* string to execute */ { case 1: ereport(LOG, - (errmsg("duration: %s ms", msec_str))); + (errmsg("duration: %s ms", msec_str), + errhidestmt(true))); break; case 2: ereport(LOG, (errmsg("duration: %s ms parse %s: %s", msec_str, *stmt_name ? stmt_name : "", - query_string))); + query_string), + errhidestmt(true))); break; } @@ -1635,7 +1640,8 @@ exec_bind_message(StringInfo input_message) { case 1: ereport(LOG, - (errmsg("duration: %s ms", msec_str))); + (errmsg("duration: %s ms", msec_str), + errhidestmt(true))); break; case 2: ereport(LOG, @@ -1645,6 +1651,7 @@ exec_bind_message(StringInfo input_message) *portal_name ? "/" : "", *portal_name ? portal_name : "", pstmt->query_string ? pstmt->query_string : ""), + errhidestmt(true), errdetail_params(params))); break; } @@ -1778,6 +1785,7 @@ exec_execute_message(const char *portal_name, long max_rows) *portal_name ? portal_name : "", sourceText ? ": " : "", sourceText ? sourceText : ""), + errhidestmt(true), errdetail_params(portalParams))); was_logged = true; } @@ -1846,7 +1854,8 @@ exec_execute_message(const char *portal_name, long max_rows) { case 1: ereport(LOG, - (errmsg("duration: %s ms", msec_str))); + (errmsg("duration: %s ms", msec_str), + errhidestmt(true))); break; case 2: ereport(LOG, @@ -1860,6 +1869,7 @@ exec_execute_message(const char *portal_name, long max_rows) *portal_name ? portal_name : "", sourceText ? ": " : "", sourceText ? sourceText : ""), + errhidestmt(true), errdetail_params(portalParams))); break; } -- cgit v1.2.3