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 1tetjW-00GGQg-VV for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 10:31:15 +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 1tetjV-00CAw7-Kk for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 10:31:13 +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 1tetjV-00CAvs-8R for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 10:31:13 +0000 Received: from udcm-wwu1.uni-muenster.de ([128.176.118.7]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tetjS-0031AX-0i for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 10:31:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-muenster.de; i=@uni-muenster.de; q=dns/txt; s=uniout; t=1738578671; x=1770114671; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=HWA8nsc+llDO2mTMM3IgMO/jn38a5+1L6nux0dzHpWo=; b=leG+fTBteIQHm40Do19vbGP+DSI5eYPCcR0WM4yqK80MiSobm+6mZHZ3 qFCZBCs/rGYdRmXe4wZAi3wedlb7wTB2If5bedbvvxZke+0hQ5xGyjm/A SCHDhyVyCzre+IMjRxFbDNG4F+1+vaTs7SdII4wXjIs6ktJP1FXmDFKnn UoPLW4b2LrlOJJtxs6Mmvh6QV018CFTJcFCp8LKnWaW3EMhKsLVM6b4Dw +7tYfJIpsyxSM7W2SKSIj3UljYfdagn/Ucsdz3ZIN3c+usRo15YJ66Q0r CXpEymhEsaJz1/aZikPEzm5bldZUBax/8dzAsDiTMDCB+8QZ1UmKU92ni Q==; X-CSE-ConnectionGUID: kGDCRjWkQrSxMyq42Bq7ew== X-CSE-MsgGUID: kb0JU7oUQciIfyNjNrCT8Q== X-IronPort-AV: E=Sophos;i="6.13,255,1732575600"; d="scan'208";a="354617494" Received: from secmail.uni-muenster.de ([128.176.118.4]) by UDCM-RELAY1.UNI-MUENSTER.DE with ESMTP; 03 Feb 2025 11:31:10 +0100 Received: from [192.168.178.27] (dynamic-077-176-011-171.77.176.pool.telefonica.de [77.176.11.171]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTPSA id 71F0620ADF03; Mon, 3 Feb 2025 11:31:08 +0100 (CET) Message-ID: <0198dc87-6f25-464e-ba55-a0fbac069241@uni-muenster.de> Date: Mon, 3 Feb 2025 11:31:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Truncate logs by max_log_size To: Kirill Gavrilov Cc: Kirill Reshke , "Andrey M. Borodin" , Euler Taveira , pgsql-hackers@lists.postgresql.org References: <94d53a41-d1f5-4fd1-8d1e-ff36ac569848@app.fastmail.com> <4DA5A159-39FD-47DB-95E5-A4F65BC5782A@yandex-team.ru> <53e96b5a-cc77-4afa-8103-79c69afef1a6@uni-muenster.de> <748a7ec0-9126-4f27-a2a7-e3e449d6fdd7@uni-muenster.de> <8a240667-de9e-455b-b3e2-62f34ec80154@uni-muenster.de> <3f1b817f-6e7a-4e01-bfc5-50ea3724225e@uni-muenster.de> Content-Language: en-US, de-DE From: Jim Jones In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Kirill On 31.01.25 11:46, Kirill Gavrilov wrote: > Sorry for the long silence.  I fixed the indentation and a trailing > whitespace. Should look fine now. The patch applies cleanly, the documentation is clear, and all tests pass. It is possible to change this new parameter session-wise, which is nice! postgres=# SET max_log_size TO 7; SET postgres=# SHOW max_log_size;  max_log_size --------------  7B (1 row) The default value now is clear and it corresponds to the value set on postgresql.conf: #max_log_size = 0       # max size of logged statement  postgres=# SHOW max_log_size;  max_log_size --------------  0 (1 row) Logs are truncated as expected: postgres=# SET max_log_size TO 6; SET postgres=# SELECT length('CALL xyz;');  length --------       9 (1 row) postgres=# CALL xyz; ERROR:  syntax error at or near ";" LINE 1: CALL xyz; log entry: 2025-02-03 10:58:19.975 CET [123945] ERROR:  syntax error at or near ";" at character 9 2025-02-03 10:58:19.975 CET [123945] STATEMENT:  CALL x The issue with log entry sizes for queries containing special characters was resolved by setting the unit to bytes. Overall, everythingLGTM. The new status of this patch is: Ready for Committer Jim