Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFvoR-005iWE-03 for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 15:17:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFvoQ-002KzZ-0j for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 15:17:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFvoP-002KzQ-2q for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 15:17:53 +0000 Received: from udcm-wwu2.uni-muenster.de ([128.176.118.28]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wFvoL-00000002fSG-2HgX for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 15:17:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-muenster.de; i=@uni-muenster.de; q=dns/txt; s=uniout; t=1776957470; x=1808493470; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=7WfHc/pssfH6uWWC4sPDwFk4Phzlg7mXUw+oEXN+9IM=; b=KsHVXn7D66nTuXr7FYQn+GhL9J9C8OVmXRWcjEMuKsFzbg42F3A1huG3 KGZz4qypmyM1F6CCP2f9WnuthdrMvU1FBQ6PO4WfI0vI9ncR182LRbtyt w2a4NW+DSjWHzoEGauqOn1YRMp4T3VYRTArgN84vpWAn9rWNoSJxULihY oB1cEM35Fi/6NXEZxOvpWwYiIB6H/2cTn8YZ2YumkxBZ4osKkaK20kN4Y zil7uf3c31ihSRLoZPW+HGYAC71KZvw8LF0UnV49givkE5+y3jzukQ1oE hRzMCFYVu7X/DCb8I70gLk6XAx84bGOraHc2573nJKyq4bvZzJ93xoQjp w==; X-CSE-ConnectionGUID: bT+o8cscSbi1HSFTRUbvgw== X-CSE-MsgGUID: JQ2O4kjGSCqnxtGS98UQDQ== X-IronPort-AV: E=Sophos;i="6.23,194,1770591600"; d="scan'208";a="391891043" Received: from secmail.uni-muenster.de ([128.176.118.4]) by UDCM-RELAY2.UNI-MUENSTER.DE with ESMTP; 23 Apr 2026 17:17:49 +0200 Received: from [192.168.178.40] (dynamic-002-243-185-250.2.243.pool.telefonica.de [2.243.185.250]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTPSA id D5FD120ADF03; Thu, 23 Apr 2026 17:17:47 +0200 (CEST) Message-ID: Date: Thu, 23 Apr 2026 17:17:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PoC - psql - emphases line with table name in verbose output To: Pavel Stehule , PostgreSQL Hackers References: Content-Language: de-DE, en-GB From: Jim Jones In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Pavel On 14/04/2026 05:42, Pavel Stehule wrote: > rebase, new commit message and minor cleaning Thanks for the patch! I tested the patch and setting PG_COLOR highlights the INFO messages. A few observations: == string matching is locale-fragile == Since the code relies on these fixed strings ... if (level == PG_LOG_INFO && sgr_info_command && (strncmp(buf, "INFO: vacuuming", strlen("INFO: vacuuming")) == 0 || strncmp(buf, "INFO: repacking", strlen("INFO: repacking")) == 0 || strncmp(buf, "INFO: analyzing", strlen("INFO: analyzing")) == 0)) .. the conditions only work if lc_messages is set to English. For instance, in German you get a different string, which means that highlighting won't work: $ psql postgres -c "VACUUM VERBOSE pg_class;" 2>&1 | grep INFO INFO: Vacuum von »postgres.pg_catalog.pg_class« INFO: beende Vacuum der Tabelle »postgres.pg_catalog.pg_class«: Index-Scans: 0 $ psql postgres -c "ANALYSE VERBOSE pg_class;" 2>&1 | grep INFO INFO: analysiere »pg_catalog.pg_class« INFO: »pg_class«: 15 von 15 Seiten gelesen, enthalten 452 lebende Zeilen und 0 tote Zeilen; 452 Zeilen in Stichprobe, schätzungsweise 452 Zeilen insgesamt INFO: finished analyzing table "postgres.pg_catalog.pg_class" == fixed command list == Future verbose operations, if not added to this list, would silently get no highlighting. I'm wondering if it is possible to achieve it (locale-agnostic) only for certain commands without touching the code on the server side. Only by checking strings it'll be difficult to identify which INFO messages to highlight. Thanks! Best, Jim