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.94.2) (envelope-from ) id 1uuCIv-004Tbb-Hy for pgsql-general@arkaria.postgresql.org; Thu, 04 Sep 2025 15:55:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uuCHv-0001by-F5 for pgsql-general@arkaria.postgresql.org; Thu, 04 Sep 2025 15:54:15 +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.94.2) (envelope-from ) id 1uuCHu-0001bp-Q2 for pgsql-general@lists.postgresql.org; Thu, 04 Sep 2025 15:54:15 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uuCHq-000YdS-0o for pgsql-general@lists.postgresql.org; Thu, 04 Sep 2025 15:54:14 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id C1A231D00328; Thu, 4 Sep 2025 11:54:08 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Thu, 04 Sep 2025 11:54:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.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=fm3; t=1757001248; x=1757087648; bh=KlS3GZ/7ae1tk6BGTQHWKtIKWVFpu2tbzi1whQNfOzY=; b= 16c6z6KaS/6M5yBB3JitwMKmR7/PxC2l4Av03KK9OwW4IIJ05urhc8BTjb9dO73D 3qy/G64kUMHD1NzoROa79jMEVvhdB16gVgSaBrrRXZtU7DUH8Ly3RBfbEbH6y7av sf8L72D01GPZ8Gg+xXhRafHogfbmMlK/8ZgbH52TaWJ8V3xJlX+zv4/I9kAsxJiq lpwpugC9baelQmwMy7wrfdoQ8OcGJ6cpgOU2e5VPym2kkrew/brBRT6sts5qp8os GBNUiw3peTYVq6RuwfSs6UHEKnkF8+K/DAT4xMXak7s+/DDWpl5Ox+BreRrNznWj xmMi4TzDO0C0Cr5VW5KGgA== 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=fm1; t=1757001248; x= 1757087648; bh=KlS3GZ/7ae1tk6BGTQHWKtIKWVFpu2tbzi1whQNfOzY=; b=J zgTig1WkjsroKzPEez96SXob9HIDPVTAyv7f34L/WSrfVxYL9FgcJws779/B0bNH ZS8a6TVMP9J4NyaWXCfVa1zaW1Se6ie1EjNdRMuoe2LYzGvkPQoWfCtOEULcEKdY Sz4d65w48UP6UbCRWnqOXPgP0jttTv62ol4myu89/u8EW4khq3CC8deArTmBub58 QGT1PO4xk4Vejhzgcmtva6zAlQ1UYj4fQeY/+7+L0/iU0nJB0n2ACLh1sikn2GiU Nti7sHMPnFLfSpbcvDeiG7pCoHSDDbCE27Dz3hgVi3uXDkgISy/mNMh9Qy+gA8m5 HwBTWQWoP4zEDuJtgA3Kw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdeigeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttd dvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghv vghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeekffduvdetkeejje evfedukeegfeffuedvhfetudduteevhfehteejffehgfeifeenucffohhmrghinhepphhs higtohhpghdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggp rhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrlhgsrhgvtg hhthdrughrvghsshesphhoshhtvghordguvgdprhgtphhtthhopehtghhlsehsshhsrdhp ghhhrdhprgdruhhspdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtsh drphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Sep 2025 11:54:07 -0400 (EDT) Message-ID: Date: Thu, 4 Sep 2025 08:54:07 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Q: limit the length of log file entries? To: =?UTF-8?Q?Albrecht_Dre=C3=9F?= , Tom Lane Cc: pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/4/25 08:48, Albrecht Dreß wrote: > Am 03.09.25 21:07 schrieb(en) Tom Lane: >> There isn't any provision for limiting the length of source queries >> quoted in the log. > > I see, thanks for the clarification. IMHO, it would be nice to have such an option, though… > >> Had your user sent the bytea value as a query >> parameter, then log_parameter_max_length[_on_error] would have >> applied, but this looks like the value was just inline in the query. > > I can confirm that the limitation is applied when I call PQexecParams() from a little c test application with the data included in the paramValues array. The overlong log lines result from queries in a Python script using the psycopg2 module – no idea how this component formats the query. The best explanation is found from the psycopg(3) docs: https://www.psycopg.org/psycopg3/docs/basic/from_pg2.html Differences from psycopg2 "Psycopg 3 sends the query and the parameters to the server separately, instead of merging them on the client side. Server-side binding works for normal SELECT and data manipulation statements (INSERT, UPDATE, DELETE), but it doesn’t work with many other statements. For instance, it doesn’t work with SET or with NOTIFY:" > > Thanks again, > Albrecht. -- Adrian Klaver adrian.klaver@aklaver.com