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 1vl4vB-006gyq-0u for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 12:45:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vl4vA-001Mzo-1J for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 12:45:20 +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 1vl4v9-001Mzg-2O for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 12:45:20 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vl4v7-002je4-0c for pgsql-hackers@postgresql.org; Wed, 28 Jan 2026 12:45:19 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 24ECF1400157; Wed, 28 Jan 2026 07:45:17 -0500 (EST) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-06.internal (MEProxy); Wed, 28 Jan 2026 07:45:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1769604317; x=1769690717; bh=7xGYkNEqJD8aN2W24AWF8okTgSDRv7zkDWakki17pAs=; b= PSbiMkTKyIPSo36C/zro9mwIIpsfFTO/0qBWjCnWvfHkZ/CDKk75QWEKlW5mmyHl URzRgddIo/ozfpYnQzuTlY9tudcdtGAnzsQJ7tOzJERapSEmm2wG6gA4tpy1FqJg vp/HXc53QD7GBM8f6N+16Gk4nZTrgUMClAOLXNLBqUxS31dpUhFTqFPD3WcbBcYa Z4eEtejbjJDjWAvtktdffjmlhXU8majbNsY9s+F/dXm/TGztgmc+YX3Ago5g4I3Q li1ANr8Tk8mt33hbhk+FECabkiwEpGxOK2PNVtiTxSIKrobxVlvEJ6aRO8PmphE4 VN4MdPII+4A2q0Cz1qkEkA== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1769604317; x= 1769690717; bh=7xGYkNEqJD8aN2W24AWF8okTgSDRv7zkDWakki17pAs=; b=E EDD60pA8eWjI0hoCsZS42N0v2Sy1IW0tZsDoEQfG2I+sPXdIIryNF7mg3ujS4EyW Y3NVFZvt+yzjYNz651FewklBdxZ4taKblb5vgiGju12mbaVDtiMrqsNb7he3etNh Nev0HZf6YIu1CV5qR6SmKzVIy3h441wWHb/89Hph5XRQKOYhXDSFN0AhyMSTym7g 32D8F5A6iNNiT1q6ErbbgKFr8SMCqaqNUiTRQ+Im/+g8rmaTNs2X1r58s7t/DDUp H5qrIL5uk7gUAyzlH3c4N8XwCKrCWw4dOdLxdyJsnpEid76Ojzf+j67oIcMTxaex twabF0FnbakgNE39NfWJw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduieefgedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfgfhulhgv rhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecuggftrf grthhtvghrnhepleevgfeileegfffglefgfeefffeghfefvdeftdduvdffieeijeffudel iefhvdevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvuhhlvghrsegvuhhl vghrthhordgtohhmpdhnsggprhgtphhtthhopedutddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepsghoshhsrghrthhnsegrmhgriihonhdrtghomhdprhgtphhtthhopehg ihhllhgvshesuggrrhholhgurdhnvghtpdhrtghpthhtoheprghnughrvgifseguuhhnsh hlrghnvgdrnhgvthdprhgtphhtthhopehtshhinhhghhhurghluhgtkhihleduvdesfhho gihmrghilhdrtghomhdprhgtphhtthhopehlihhugihhrdiijhdrtghnsehgmhgrihhlrd gtohhmpdhrtghpthhtohepnhhiuhhshhhijhhisehgmhgrihhlrdgtohhmpdhrtghpthht ohepshhhihihuhgvfhgvihdutddtgeesghhmrghilhdrtghomhdprhgtphhtthhopehjrg hpihhnlhhisehhohhtmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghk vghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 0E88F182007A; Wed, 28 Jan 2026 07:45:15 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: ALvzPRv-w3yJ Date: Wed, 28 Jan 2026 09:44:55 -0300 From: "Euler Taveira" To: "Gilles Darold" , japin Cc: "Yuefei Shi" , songjinzhou , pgsql-hackers , "Andrew Dunstan" , "Bossart, Nathan" , "Tom Lane" , "liu xiaohui" , "Steven Niu" Message-Id: In-Reply-To: References: <129bcfbf-47a6-e58a-190a-62fc21a17d03@migops.com> <786b70c5-ee75-4450-84e7-936a20de63b9@gmail.com> <7aa9c67e-c423-43c4-89e8-4fbe8f5019d2@darold.net> <3002ddbd-64b5-499e-b15c-e1c1720cc356@darold.net> <94634e38-7184-42a1-b9e1-7611076e1c08@darold.net> Subject: Re: Pasword expiration warning Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 9, 2026, at 8:27 AM, Gilles Darold wrote: > > Here is a v11 version of the patch. > + if (result <= (TimestampTz) password_expire_warning) + { + MyClientConnectionInfo.warning_message = + psprintf(_("your password will expire in %d day(s)"), + (int) (result / SECS_PER_DAY)); + } You should use ngettext() for plural forms. I don't think you need a string into ClientConnectionInfo. Instead, you could store only the number of days. + /* + * Emit a warning message to the client when set, for example + * to warn the user that the password will expire. + */ + if (MyClientConnectionInfo.warning_message) + ereport(WARNING, (errmsg("%s", MyClientConnectionInfo.warning_message))); + ... and you construct the message directly in the ereport(). -- Euler Taveira EDB https://www.enterprisedb.com/