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 1tGfQ9-003zab-DV for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Nov 2024 14:23:05 +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 1tGfQ7-005NrF-Re for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Nov 2024 14:23:03 +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 1tGfQ7-005Nr7-FT for pgsql-hackers@lists.postgresql.org; Thu, 28 Nov 2024 14:23:03 +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 1tGfQ4-004Voc-Lg for pgsql-hackers@lists.postgresql.org; Thu, 28 Nov 2024 14:23:02 +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=1732803781; x=1764339781; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=q4MsHz6QPGKNSTtshJgIivIQypdva9hh6eCGXwLZW/E=; b=Pg6rBCi/WN9EeP4+5cl5/Hed7w83aGKBFhC87JQeERekC63DEJwWhaBC AlKFbG7KFFbN6HjIobc7cGBtKR7S7P5ftgDDaAdipWkUyiKBkZF6XcF5N QcpG9EEYLZvE8AnjnxoD17XStIXy354Utc3pmxthlGL80HgNVTXjXfsii wnPnRlSOeOIvSmilVEtskqflAvmEtmbSt/DLsQZymDpqx3brZgDMXl64Z Xg2u2yCiAlIQPsRcZAX0aXiZNdRGxyg6NvxEDMCKTQApDCKdZML59Dx/V /eiiogANHg+E3nZ+yHnKVJbong9T+y9Yu9XT+9BmEBoapxzK84CCkJEa4 A==; X-CSE-ConnectionGUID: lamNUQ7hSeKKWA9nG5Ao9w== X-CSE-MsgGUID: 63wsr8xDRwKZjp2Cp0/zuw== X-IronPort-AV: E=Sophos;i="6.12,192,1728943200"; d="scan'208";a="350027584" Received: from secmail.uni-muenster.de ([128.176.118.4]) by UDCM-RELAY1.UNI-MUENSTER.DE with ESMTP; 28 Nov 2024 15:23:00 +0100 Received: from [192.168.178.27] (dynamic-093-131-193-064.93.131.pool.telefonica.de [93.131.193.64]) by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTPSA id BE86D20A61E3; Thu, 28 Nov 2024 15:22:57 +0100 (CET) Message-ID: <748a7ec0-9126-4f27-a2a7-e3e449d6fdd7@uni-muenster.de> Date: Thu, 28 Nov 2024 15:22:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Truncate logs by max_log_size To: Kirill Reshke , Kirill Gavrilov Cc: "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> Content-Language: en-US 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 On 25.11.24 17:52, Kirill Reshke wrote: > Hello! Please deliver the most recent patch version and fix the issues > Jim identified [0] as the current commitfest draws to a close. > Do not forget to include both parts of this patch (This was actually > developed off-list, and we are now using this on our cloud PostgreSQL > distribution on versions 12–17). > > [0] https://www.postgresql.org/message-id/35096a36-04d4-480b-a7cd-a2d8151fb737%40uni-muenster.de In addition to these points, this feature seems to fail with queries containing special characters (more than one byte): With this "max_log_size".. postgres=# SHOW max_log_size;  max_log_size --------------  20 (1 row) ... and this query .. postgres=# SELECT "ÄÜÖ" FROM t; ERROR:  relation "t" does not exist LINE 1: SELECT "ÄÜÖ" FROM t; .. this is the [truncated] log entry we get .. 2024-11-28 14:58:57.912 CET [2258876] ERROR:  relation "t" does not exist at character 19 2024-11-28 14:58:57.912 CET [2258876] STATEMENT:  SELECT "ÄÜÖ" FROM ... although the query originally had exactly 20 characters: postgres=# SELECT length('SELECT "ÄÜÖ" FROM t;');  length --------      20 (1 row) postgres=# SELECT length('ÄÜÖ'::bytea), length('AUO'::bytea);  length | length --------+--------       6 |      3 (1 row) If it is supposed to be like this, it should be clearly stated so in the docs. -- Jim