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 1vbMHW-004c5G-03 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jan 2026 17:16:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vbMHU-008jsT-32 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jan 2026 17:16:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vbMHU-008jsL-1u for pgsql-hackers@lists.postgresql.org; Thu, 01 Jan 2026 17:16:13 +0000 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vbMHT-003gOe-31 for pgsql-hackers@lists.postgresql.org; Thu, 01 Jan 2026 17:16:12 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1CF987A005A; Thu, 1 Jan 2026 12:16:10 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Thu, 01 Jan 2026 12:16:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1767287769; x= 1767374169; bh=ehuW1VqZGorQxZsr9wkmc0ZO46sFEXgypN9qKV8shMQ=; b=l LN2lcnHC47vBsMW6q4dVc5KtokB7JUaaBSNvT2T2vEtHObixes5AARxd5WXSm+to H+vN2si/XZfOqv4pQTuzN1RT8l4FSAsD8pW4xAPYXOWBwD5s1NuHJaj0xwnFLsug Ef4KlHMU1EEARKrG6HCMMg+F8r+YmfJasxnRgn4g+XCM1pFjzLwoFm6RfAvKeZD6 bEmEz5rMeqVyEuuaq/ahIZPoubAkGxnGfSce90rqwyUaTUfUAyiCBAaL52Uudz41 tIUGvFO7f871EAgYt7Q7OMrZS6k/Bu6Y5o5gPdnCwoJ4U7CGc1mpt6Tx4UCCvObH GJ+ptqLG5OmKp33R+SpXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1767287769; x=1767374169; bh=e huW1VqZGorQxZsr9wkmc0ZO46sFEXgypN9qKV8shMQ=; b=yd+IXuTk9jPx6WYfu Y+JKc4hc4ChiR3eASr9x3Td77pW21zCYBtevlphfg8gRxU+GrBSj2XvezJNBwlYb x+XE5h1xbyyJCCRwU1F4Qe1nHxjzup4NUWd2O3lFXieynKQ3U7zWodrvS1wzgLUf 9inLReDq/AsSJm2VGB1cpivqRvZc40gl12RF+Xo5eJcYrpCZipJDS1EE/x8C4vPg TL9ApzZIjtpdSm8wjWfGZIvCeCf47ZeOt5JDX9kcf4d8o0vJezid4E7IWuzyRs1R oKwfcuf2m1ET9rflL1xIimrHV2Ocupr4ESvJ4qOaDwX+A5dP5BV4XtVecriVis0s QqGOw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdekieefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpemllhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrf grthhtvghrnhepgfejuedtveeufefhueefieefieegueffhfevueeguddtueefteeuhedv leeffeejnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhdptghrihhngh gvlhihrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomheprghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhope elpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrnhgurhgvshesrghnrghrrgii vghlrdguvgdprhgtphhtthhopegrvghkohhrohhtkhhovhesghhmrghilhdrtghomhdprh gtphhtthhopehjihgrnhdruhhnihhvvghrshgrlhhithihsehgmhgrihhlrdgtohhmpdhr tghpthhtoheplhhirdgvvhgrnhdrtghhrghosehgmhgrihhlrdgtohhmpdhrtghpthhtoh epgihunhgvnhhgiihhohhusehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdq hhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtoh epmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidprhgtphhtthhopeihrdhsohhkohhl ohhvsehpohhsthhgrhgvshhprhhordhruhdprhgtphhtthhopehtohhmrghssehvohhnug hrrgdrmhgv X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Jan 2026 12:16:08 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1767287766; bh=qVWTy4F5G668CEZtxGum3WEzHbK2EriCGiV30weeg38=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=IIGSfS3fNTnOjnp/Tnj6Iq8K8oQh+0VUAIiQRKLl5zzFiJzHeJ+fiMfasdvDsc+JS EIiPONq7Bhe8BKY+GQvho4XE6Xrn2t5vInJCrezCVp7P9VRZ5ejVkaZns/3moB2WRw Muixk8pJHlh8Rill49xMdTdz0kIaoa/NnOH3hJZ/lseHjJYc2kZcMcdvaHmtDc2B6I 0KyLfJxQh+OdHeo0Dvk6hRS9m6jOf6yP3sjMLWRxd4B1CUAQP2O7f/L2pNLiQHiphT +y0HwkIkUKV2BTJdnCODQUI2tj99WAa57OmncFfxO/fmU8LB9igknnnoSRLRxvu1Uw UkvFNPy/ahKpQ== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 0628978; Thu, 01 Jan 2026 14:16:05 -0300 (-03) Date: Thu, 1 Jan 2026 14:16:05 -0300 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Xuneng Zhou Cc: Chao Li , Alexander Korotkov , pgsql-hackers , Andres Freund , Michael Paquier , jian he , Tomas Vondra , Yura Sokolov Subject: Re: Implement waiting for wal lsn replay: reloaded Message-ID: <202601011659.ikh4ku4p3ovb@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk In 0002 you have this kind of thing: > ereport(ERROR, > errcode(ERRCODE_QUERY_CANCELED), > - errmsg("timed out while waiting for target LSN %X/%08X to be replayed; current replay LSN %X/%08X", > + errmsg("timed out while waiting for target LSN %X/%08X to be %s; current %s LSN %X/%08X", > LSN_FORMAT_ARGS(lsn), > - LSN_FORMAT_ARGS(GetXLogReplayRecPtr(NULL)))); > + desc->verb, > + desc->noun, > + LSN_FORMAT_ARGS(currentLSN))); > + } I'm afraid this technique doesn't work, for translatability reasons. Your whole design of having a struct with ->verb and ->noun is not workable (which is a pity, but you can't really fight this.) You need to spell out the whole messages for each case, something like if (lsntype == replay) ereport(ERROR, errcode(ERRCODE_QUERY_CANCELED), errmsg("timed out while waiting for target LSN %X/%08X to be replayed; current standby_replay LSN %X/%08X", else if (lsntype == flush) ereport( ... ) and so on. This means four separate messages for translation for each message your patch is adding, which is IMO the correct approach. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "... In accounting terms this makes perfect sense. To rational humans, it is insane. Welcome to IBM." (Robert X. Cringely) https://www.cringely.com/2015/06/03/autodesks-john-walker-explained-hp-and-ibm-in-1991/