From: Tatsuo Ishii Date: Sat, 14 Jun 2025 11:54:13 +0000 (+0900) Subject: Enhance lifecheck log. X-Git-Url: http://git.postgresql.org/gitweb/%40%40?a=commitdiff_plain;p=pgpool2.git Enhance lifecheck log. Previously when wd_lifecheck_method = 'query', life checking prints SQL without application name if "%a" is specified in log_line_prefix. This commit add application_name "lifecheck_ping" to make the log looks better. Since this changes user visible behavior, I do not apply this to stable branches. Discussion: [pgpool-hackers: 4603] life check log is not nice https://www.pgpool.net/pipermail/pgpool-hackers/2025-June/004604.html --- diff --git a/src/watchdog/wd_lifecheck.c b/src/watchdog/wd_lifecheck.c index c399128b4..ce99a4000 100644 --- a/src/watchdog/wd_lifecheck.c +++ b/src/watchdog/wd_lifecheck.c @@ -6,7 +6,7 @@ * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * - * Copyright (c) 2003-2022 PgPool Global Development Group + * Copyright (c) 2003-2025 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -943,13 +943,15 @@ create_conn(char *hostname, int port, char *password) } snprintf(conninfo, sizeof(conninfo), - "host='%s' port='%d' dbname='%s' user='%s' password='%s' connect_timeout='%d'", + "host='%s' port='%d' dbname='%s' user='%s' password='%s' connect_timeout='%d' application_name='%s'", hostname, port, pool_config->wd_lifecheck_dbname, pool_config->wd_lifecheck_user, password ? password : "", - pool_config->wd_interval / 2 + 1); + pool_config->wd_interval / 2 + 1, + "lifecheck_ping"); + conn = PQconnectdb(conninfo); if (PQstatus(conn) != CONNECTION_OK)