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 1vnL2e-005MEZ-22 for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Feb 2026 18:22:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vnL2b-006mED-2p for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Feb 2026 18:22:21 +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 1vnL2b-006mE5-1h for pgsql-hackers@lists.postgresql.org; Tue, 03 Feb 2026 18:22:21 +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 1vnL2Z-00000000tYI-0Mpj for pgsql-hackers@lists.postgresql.org; Tue, 03 Feb 2026 18:22:21 +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=1770142940; x=1801678940; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=NlyHio89SntJDHrLnGI8QnZAW3lOAJRVPdcBHx00gKo=; b=mehHbR0QKmTGpvp0yWdoNn6C0Om+vQXIyK0I4xu6knhB4cnl1I+HZdAA gMOSBalZl2onnUyrXi5wFQLJdgumr7uQSmXPBXcbNhvo48kFIjc5VfKaI qlYn6CatrdCzpCCnuPBHc6h/KxugRIfyroySSX1NjR90QCXWWIIn2mwoj m4HZ7y3UgUJDJwrqK4MNRepU9WWSzB6RPRPkWS6AD23lnL+7Vi/3VBPga yjRFgAclohRGqM9EF6LObloEGi9ERnceqKFimGJbg0MaGpFfyq+UEAhdN Vq+lGKY7s7/EAg/BciYTexq4+KxWehIdBeworKUnnSHKFrkaFNaCxBNp2 A==; X-CSE-ConnectionGUID: vp8F2RTkSsegzaNpllQiFA== X-CSE-MsgGUID: sKWnJ+hhSraEzXa613l5Ow== X-IronPort-AV: E=Sophos;i="6.21,271,1763420400"; d="scan'208";a="383543554" Received: from secmail.uni-muenster.de ([128.176.118.4]) by UDCM-RELAY2.UNI-MUENSTER.DE with ESMTP; 03 Feb 2026 19:22:19 +0100 Received: from [192.168.178.27] (dynamic-093-132-089-216.93.132.pool.telefonica.de [93.132.89.216]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTPSA id 8DD0F20ADF02; Tue, 3 Feb 2026 19:22:17 +0100 (CET) Message-ID: <76e0edf2-4be3-458a-86e4-35b9dd836f31@uni-muenster.de> Date: Tue, 3 Feb 2026 19:22:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Additional message in pg_terminate_backend To: Roman Khapov , Andrey Borodin Cc: Kirill Reshke , Daniel Gustafsson , pgsql-hackers@lists.postgresql.org References: <064E214D-D86F-4917-A0B6-67EAD6BCB24A@yandex-team.ru> <99f3524c-6aee-4fe2-8f3f-fcf0b67642c2@uni-muenster.de> <7e8c913b-1bfb-41f1-b5db-c29e2af48daa@uni-muenster.de> <56F9A892-B3C8-4479-8FA8-3E868CDFF2FC@yandex-team.ru> Content-Language: de-DE, en-GB From: Jim Jones In-Reply-To: <56F9A892-B3C8-4479-8FA8-3E868CDFF2FC@yandex-team.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Roman On 03/02/2026 13:28, Roman Khapov wrote: > Thanks for another round on review, updated the patch according to comments. > > Also, fix `make check` by updating pg_proc.data with new functions, > similar to uuid7 way: defining _msg versions of the functions Why did you decide to revert the pg_proc.dat and system_functions.sql changes from v3? In v3 I thought that adding a msg DEFAULT '' to the corresponding function in system_functions.sql ... --- a/src/backend/catalog/system_functions.sql +++ b/src/backend/catalog/system_functions.sql @@ -400,7 +400,12 @@ CREATE OR REPLACE FUNCTION PARALLEL SAFE; CREATE OR REPLACE FUNCTION - pg_terminate_backend(pid integer, timeout int8 DEFAULT 0) + pg_cancel_backend(pid integer, msg text DEFAULT '') + RETURNS boolean STRICT VOLATILE LANGUAGE INTERNAL AS 'pg_cancel_backend' + PARALLEL SAFE; + +CREATE OR REPLACE FUNCTION + pg_terminate_backend(pid integer, timeout int8 DEFAULT 0, msg text DEFAULT '') RETURNS boolean STRICT VOLATILE LANGUAGE INTERNAL AS 'pg_terminate_backend' PARALLEL SAFE; ... and updating pg_proc.dat accordingly would do the trick diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 5e5e33f64f..47aa30d716 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -6724,10 +6724,11 @@ { oid => '2171', descr => 'cancel a server process\' current query', proname => 'pg_cancel_backend', provolatile => 'v', prorettype => 'bool', - proargtypes => 'int4', prosrc => 'pg_cancel_backend' }, + proargtypes => 'int4 text', proargnames => '{pid,msg}', + prosrc => 'pg_cancel_backend' }, { oid => '2096', descr => 'terminate a server process', proname => 'pg_terminate_backend', provolatile => 'v', prorettype => 'bool', - proargtypes => 'int4 int8', proargnames => '{pid,timeout}', + proargtypes => 'int4 int8 text', proargnames => '{pid,timeout,msg}', prosrc => 'pg_terminate_backend' }, { oid => '2172', descr => 'prepare for taking an online backup', proname => 'pg_backup_start', provolatile => 'v', proparallel => 'r', My rationale is based on the header in system_function.sql: ... * src/backend/catalog/system_functions.sql * * This file redefines certain built-in functions that are impractical * to fully define in pg_proc.dat. In most cases that's because they use * SQL-standard function bodies and/or default expressions... Am I missing something? Thanks Best, Jim