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 1svbMB-00GJn5-CV for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Oct 2024 11:47:56 +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 1svbLB-00FPeO-4P for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Oct 2024 11:46:53 +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 1svbLA-00FPeF-OD for pgsql-hackers@lists.postgresql.org; Tue, 01 Oct 2024 11:46:52 +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.94.2) (envelope-from ) id 1svbL6-0020RV-OH for pgsql-hackers@lists.postgresql.org; Tue, 01 Oct 2024 11:46:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-muenster.de; i=@uni-muenster.de; q=dns/txt; s=uniout; t=1727783210; x=1759319210; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=pNLFD+LJx9QbhnG4a9a732NVngglhrkfZjYQzHqvIEA=; b=g7HJZhZqWe+lIFdO4FBR/W7fPU8Z7QbkuSsp9T+3YSgFFS7UTMOJ6IjH I9bqWEUWNG80XAN517CBqfrhQlDdz/hK+xKGm/x0L6L5tE1MefyywQWKw 3TPjTkt5tT8Iq+IEbPbz1GK4FiZAmESJ4ddiUAovFzWs3LBujShYnuXqW bOFz6PVAcpDFkgQZoltpt1/8xVgfx9Htexbj6phhOwZ9f0rX87kCWzSk2 Vzxt7WOUC/NOlIdDS2+OSteHtuYF+9zfvmtDoKGYmpakbcMyvQBqR3l/U VHMdRuIagYaLU0xhFqHl2dCxn53yZC7Urii1vPF7haTN70ESb/J6lm/h8 g==; X-CSE-ConnectionGUID: noBA2gZaR9yIcSinwPTyjQ== X-CSE-MsgGUID: 48aBvTmWRvK1w3cDptKscg== X-IronPort-AV: E=Sophos;i="6.11,167,1725314400"; d="scan'208";a="345185264" Received: from secmail.uni-muenster.de ([128.176.118.4]) by UDCM-RELAY1.UNI-MUENSTER.DE with ESMTP; 01 Oct 2024 13:46:48 +0200 Received: from [192.168.178.27] (dynamic-093-133-134-071.93.133.pool.telefonica.de [93.133.134.71]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTPSA id 8522C20ADF01; Tue, 1 Oct 2024 13:46:45 +0200 (CEST) Message-ID: <53e96b5a-cc77-4afa-8103-79c69afef1a6@uni-muenster.de> Date: Tue, 1 Oct 2024 13:46:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Truncate logs by max_log_size To: "Andrey M. Borodin" , Euler Taveira Cc: diPhantxm , pgsql-hackers@lists.postgresql.org References: <94d53a41-d1f5-4fd1-8d1e-ff36ac569848@app.fastmail.com> <4DA5A159-39FD-47DB-95E5-A4F65BC5782A@yandex-team.ru> Content-Language: en-US From: Jim Jones In-Reply-To: <4DA5A159-39FD-47DB-95E5-A4F65BC5782A@yandex-team.ru> 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 On 27.09.24 12:36, Andrey M. Borodin wrote: > Consider max_log_size = 10Mb. The perspective might look very different. > It’s not about WHERE anymore. It's a guard against heavy abuse. > > The feature looks very important for me. I have the same opinion. As a fail safe it sounds very useful to me. Unfortunately, the patch does not apply: $ git apply ~/patches/max_log_query/0001-parameter-max_log_size-to-truncate-logs.patch -v Checking patch src/backend/utils/error/elog.c... error: while searching for: char       *Log_destination_string = NULL; bool            syslog_sequence_numbers = true; bool            syslog_split_messages = true; /* Processed form of backtrace_symbols GUC */ static char *backtrace_symbol_list; error: patch failed: src/backend/utils/error/elog.c:114 error: src/backend/utils/error/elog.c: patch does not apply Checking patch src/backend/utils/misc/guc_tables.c... Hunk #1 succeeded at 3714 (offset 247 lines). Checking patch src/backend/utils/misc/postgresql.conf.sample... Hunk #1 succeeded at 615 (offset 23 lines). Checking patch src/bin/pg_ctl/t/004_logrotate.pl... error: while searching for: check_log_pattern('csvlog',  $new_current_logfiles, 'syntax error', $node); check_log_pattern('jsonlog', $new_current_logfiles, 'syntax error', $node); $node->stop(); done_testing(); error: patch failed: src/bin/pg_ctl/t/004_logrotate.pl:135 error: src/bin/pg_ctl/t/004_logrotate.pl: patch does not apply Checking patch src/include/utils/elog.h... Hunk #1 succeeded at 502 (offset 1 line). Does it truncate only single queries or also a transaction with many statements? Thanks! Best, Jim