From: Bruce Momjian Date: Fri, 2 Sep 2005 21:50:54 +0000 (+0000) Subject: Add log display label for unnamed server-side portals. X-Git-Tag: REL8_1_0BETA2~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11b5c554c28b4a45cdc6b7555e90d701c40f3971;p=postgresql Add log display label for unnamed server-side portals. --- diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index aa0da207a3..f7d21c2362 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.457 2005/08/11 21:11:45 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.458 2005/09/02 21:50:54 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1164,7 +1164,9 @@ exec_parse_message(const char *query_string, /* string to execute */ if (log_statement == LOGSTMT_ALL) ereport(LOG, - (errmsg("statement: PREPARE %s AS %s", stmt_name, query_string))); + (errmsg("statement: PREPARE %s AS %s", + (*stmt_name != '\0') ? stmt_name : "", + query_string))); /* * Start up a transaction command so we can run parse analysis etc. @@ -1732,7 +1734,8 @@ exec_execute_message(const char *portal_name, long max_rows) if (log_statement == LOGSTMT_ALL) /* We have the portal, so output the source query. */ ereport(LOG, - (errmsg("statement: EXECUTE %s [PREPARE: %s]", portal_name, + (errmsg("statement: EXECUTE %s [PREPARE: %s]", + (*portal_name != '\0') ? portal_name : "", portal->sourceText ? portal->sourceText : ""))); BeginCommand(portal->commandTag, dest); @@ -1867,7 +1870,7 @@ exec_execute_message(const char *portal_name, long max_rows) (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, - portal_name, + (*portal_name != '\0') ? portal_name : "", portal->sourceText ? portal->sourceText : ""))); }