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 1utsp6-00FScp-HY for pgsql-general@arkaria.postgresql.org; Wed, 03 Sep 2025 19:07:13 +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 1utsp5-00B4Ef-Mf for pgsql-general@arkaria.postgresql.org; Wed, 03 Sep 2025 19:07:12 +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.94.2) (envelope-from ) id 1utsp5-00B4EW-Bw for pgsql-general@lists.postgresql.org; Wed, 03 Sep 2025 19:07:11 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1utsp3-000NUD-35 for pgsql-general@lists.postgresql.org; Wed, 03 Sep 2025 19:07:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 583J78eF832142; Wed, 3 Sep 2025 15:07:08 -0400 From: Tom Lane To: Albrecht =?iso-8859-1?b?RHJl3w==?= cc: pgsql-general@lists.postgresql.org Subject: Re: Q: limit the length of log file entries? In-reply-to: References: Comments: In-reply-to Albrecht =?iso-8859-1?b?RHJl3w==?= message dated "Wed, 03 Sep 2025 15:40:45 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <832140.1756926428.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 03 Sep 2025 15:07:08 -0400 Message-ID: <832141.1756926428@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Albrecht =3D?iso-8859-1?b?RHJl3w=3D=3D?=3D writ= es: > I have a PL/PGsql DB function 'addval(_id text, _data bytea) RETURNS VOI= D'. When a broken bytea is passed as 2nd parameter, something like > albrecht@test FEHLER: ung=C3=BCltige hexadezimale Ziffer: =C2=BBr=C2=AB= bei Zeichen 28 > albrecht@test ANWEISUNG: SELECT FROM addval('hopp', '\xbroken') > is printed in the log file. This is fine and very helpful in this case,= but I have a =E2=80=9Cfriendly user=E2=80=9D who transmitted a broken hex= string of ~100 KBytes as second parameter, resulting in a log line of thi= s size which is not really readable and when done frequently quickly fills= the logs. There isn't any provision for limiting the length of source queries quoted in the log. 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. regards, tom lane