Index: src/backend/tcop/postgres.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/tcop/postgres.c,v
retrieving revision 1.473
diff -c -c -r1.473 postgres.c
*** src/backend/tcop/postgres.c	30 Dec 2005 23:49:48 -0000	1.473
--- src/backend/tcop/postgres.c	31 Dec 2005 16:49:09 -0000
***************
*** 589,596 ****
  				entry->query_string)
  			{
  				*prepare_string = palloc(strlen(entry->query_string) +
! 									  strlen("  [client PREPARE:  %s]") - 1);
! 				sprintf(*prepare_string, "  [client PREPARE:  %s]",
  						entry->query_string);
  			}
  		}
--- 589,596 ----
  				entry->query_string)
  			{
  				*prepare_string = palloc(strlen(entry->query_string) +
! 									  strlen("  [protocol PREPARE:  %s]") - 1);
! 				sprintf(*prepare_string, "  [protocol PREPARE:  %s]",
  						entry->query_string);
  			}
  		}
***************
*** 1146,1152 ****
  
  	if (log_statement == LOGSTMT_ALL)
  		ereport(LOG,
! 				(errmsg("statement: [client] PREPARE %s AS %s",
  						(*stmt_name != '\0') ? stmt_name : "<unnamed>",
  						query_string)));
  
--- 1146,1152 ----
  
  	if (log_statement == LOGSTMT_ALL)
  		ereport(LOG,
! 				(errmsg("statement: [protocol] PREPARE %s AS %s",
  						(*stmt_name != '\0') ? stmt_name : "<unnamed>",
  						query_string)));
  
***************
*** 1449,1455 ****
  	/* We need to output the parameter values someday */
  	if (log_statement == LOGSTMT_ALL)
  		ereport(LOG,
! 				(errmsg("statement: [client] <BIND> %s", portal_name)));
  
  	/*
  	 * Fetch parameters, if any, and store in the portal's memory context.
--- 1449,1455 ----
  	/* We need to output the parameter values someday */
  	if (log_statement == LOGSTMT_ALL)
  		ereport(LOG,
! 				(errmsg("statement: [protocol] <BIND> %s", portal_name)));
  
  	/*
  	 * Fetch parameters, if any, and store in the portal's memory context.
***************
*** 1712,1718 ****
  	if (log_statement == LOGSTMT_ALL)
  		/* We have the portal, so output the source query. */
  		ereport(LOG,
! 				(errmsg("statement: [client] %sEXECUTE %s  [PREPARE:  %s]",
  						(execute_is_fetch) ? "FETCH from " : "",
  						(*portal_name != '\0') ? portal_name : "<unnamed>",
  						portal->sourceText ? portal->sourceText : "")));
--- 1712,1718 ----
  	if (log_statement == LOGSTMT_ALL)
  		/* We have the portal, so output the source query. */
  		ereport(LOG,
! 				(errmsg("statement: [protocol] %sEXECUTE %s  [PREPARE:  %s]",
  						(execute_is_fetch) ? "FETCH from " : "",
  						(*portal_name != '\0') ? portal_name : "<unnamed>",
  						portal->sourceText ? portal->sourceText : "")));
***************
*** 1821,1827 ****
  			(save_log_min_duration_statement > 0 &&
  			 usecs >= save_log_min_duration_statement * 1000))
  			ereport(LOG,
! 					(errmsg("duration: %ld.%03ld ms  statement: [client] %sEXECUTE %s  [PREPARE:  %s]",
  							(long) ((stop_t.tv_sec - start_t.tv_sec) * 1000 +
  								  (stop_t.tv_usec - start_t.tv_usec) / 1000),
  							(long) (stop_t.tv_usec - start_t.tv_usec) % 1000,
--- 1821,1827 ----
  			(save_log_min_duration_statement > 0 &&
  			 usecs >= save_log_min_duration_statement * 1000))
  			ereport(LOG,
! 					(errmsg("duration: %ld.%03ld ms  statement: [protocol] %sEXECUTE %s  [PREPARE:  %s]",
  							(long) ((stop_t.tv_sec - start_t.tv_sec) * 1000 +
  								  (stop_t.tv_usec - start_t.tv_usec) / 1000),
  							(long) (stop_t.tv_usec - start_t.tv_usec) % 1000,
