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 1vnwVG-00DqbB-24 for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Feb 2026 10:22:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vnwVF-00GWtj-2P for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Feb 2026 10:22:25 +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 1vnwVF-00GWta-0e for pgsql-hackers@lists.postgresql.org; Thu, 05 Feb 2026 10:22:25 +0000 Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vnwVD-00000000fK6-01qm for pgsql-hackers@lists.postgresql.org; Thu, 05 Feb 2026 10:22:24 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 33689EC030D; Thu, 5 Feb 2026 05:22:22 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 05 Feb 2026 05:22:22 -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=fm1; t=1770286942; x= 1770373342; bh=UU9bOqw9kmuIg4SvtbEHTn1QL6dVQd42APQakx0WMIs=; b=h IhUtoreatrixQ8dz5Adq4DofvAVV7XWCUyzSZHsulIYnsP53QgNUF6mq7UNsUxp1 XnGxLBGsqJHyUdMroIfyN4rk/6D38eyuMFZizkj5pV03L/VX17uoiSnHku12UDv5 obR4g6fmcCHWLVLgg6eO0oPFvE8nKAx6VsOHIMQGm4NL/hfv+7LTzzo7VYvW9K9J pMaZ6joHMlf4HZIXrTGeXQNWs56pGuV4aaUpDvPt5gIlKX2clDGjHAW1oOJpQORQ f4YwP+pofM5noKavv84yvYspQ0E56KS2HAMN0WdDh01hBfoxMUjRxbGqKDWhl02P JJrMlCKEfe11VbK21pCkg== 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=fm3; t=1770286942; x=1770373342; bh=U U9bOqw9kmuIg4SvtbEHTn1QL6dVQd42APQakx0WMIs=; b=o7ETAhXQ4B8sr3Ozs swCdlDNbo7vwvpZVfO45uUGGo8LWdNdFfDJ3nXX+miokzfWoLFYNsZM1i3y4F/Zj 9kWqJDZGJa/eE+dFiizWdyijTtfQ2MjeXMf3bROBfZbSKfvy5GplTqKn5ON0mEuQ hNtu1amvEYNrV1JEC7ukUe57A3rXXlV48sO/w/BFtBo2WXTRYBnGv4TfKcWNtpoe BCVwy3mYaAhek/2DyL9H7v2czIoI3K43qSvTcnG5uvQtC8jCKImC7oEXA+yeceqQ t1xVyPmi7uTwvJ4M5VCUJLgMpTq/bPMxA9GbEuqV7kpMRp1cBYaAXYv9nZBgdIxG WeuEg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddukeehtdegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeekpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopegvuhhlvghrsegvuhhlvghrthhordgtohhmpdhrtghpthhtohep ughiphhhrghnthigmhesghhmrghilhdrtghomhdprhgtphhtthhopehmrghsrghordhfuh hjihhisehgmhgrihhlrdgtohhmpdhrtghpthhtoheprhgvshhhkhgvkhhirhhilhhlsehg mhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtsh drphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepmhgrshgrohdrfhhujhhiihes ohhsshdrnhhtthgurghtrgdrtghomhdprhgtphhtthhopehjihhmrdhjohhnvghssehunh hiqdhmuhgvnhhsthgvrhdruggvpdhrtghpthhtohepgiegmhhmmheshigrnhguvgigqdht vggrmhdrrhhu X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Feb 2026 05:22:20 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1770286939; bh=NE4f5Qspdf7PNRKJRra81K5zMp4UpggoJMBNpMHYP2E=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=qDjmjWygIGsZY52ZW1V74G5iIo/rfPOsyMtuSqoTudSzdINgAiOC8R9Hn1ZYqgGIQ tfCSH/og6v+5VL2DkCXrB2KDkfI8f2ReAWzLN62ziOG2i9UzjE2TnDK9dDaQqXWxSF NeVnujhHSxhLbjnammm/Qs6MPWGKE/eIvL25lGUhZSzoIH+UzAnKXR+mTjbyVbTKl1 ikPbojUuRrjEJVZa9l/cZobUFvtRHylQbFKb1M5fb0D6wXJBY6h+xC0C1cbBmdx/eS OQfYkhylFgTTOccYTPj0BQXT5l1lND9D8L8YIDApjLwJRrrxVL+iytjTVasyPoXzvz bPYqLxZ1m6Atg== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 6D29E7A; Thu, 05 Feb 2026 11:22:19 +0100 (CET) Date: Thu, 5 Feb 2026 11:22:19 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Jim Jones Cc: Fujii Masao , Fujii Masao , Kirill Gavrilov , Kirill Reshke , "Andrey M. Borodin" , Euler Taveira , pgsql-hackers@lists.postgresql.org Subject: Re: Truncate logs by max_log_size Message-ID: <202602051012.qer26xklakqb@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <49861ed8-f1bc-4848-8762-703ccd344c56@uni-muenster.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Feb-05, Jim Jones wrote: > On 05/02/2026 03:17, Fujii Masao wrote: > > At least I'm not for now. So please feel free to work on the patch if > > you'd like! > > If nobody is planning to work on this, I can take a look at it next week. That'd be swell. My only comment at this point is that the proposed GUC name is not great. I think it should be something like log_statement_max_length, or something like that. Reading just the thread subject, people would imagine this is about the size of the log file. Another point is that the current patch does strlen() twice on each query. It might be better to do away with need_truncate_query_log() and have a single routine that both determines whether the truncation is needed and returns the truncated query if it is. If it returns NULL then caller assumes it's not needed. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/