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.96) (envelope-from ) id 1wm6x5-000aqy-04 for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jul 2026 09:39:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wm6x3-006eS5-1G for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jul 2026 09:39:49 +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.96) (envelope-from ) id 1wm6x3-006eRv-0J for pgsql-hackers@lists.postgresql.org; Tue, 21 Jul 2026 09:39:48 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wm6x0-00000000Ppz-2Q9W for pgsql-hackers@lists.postgresql.org; Tue, 21 Jul 2026 09:39:48 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-c15ca7a7ca9so818396366b.0 for ; Tue, 21 Jul 2026 02:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784626785; x=1785231585; darn=lists.postgresql.org; h=content-type:mime-version:user-agent:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=dtOgYuYcINt4rQ64xSupB84lDJG4RYkc7bUPyFnH3DE=; b=tEWcLj2x56v9BKuMDzf3RJOryzp2lx8jaIEj+TKMCFf3ytlE3UlDiZ6gqgoHH/pO3P mlvttKNXICjmgBUxISoEJw5H4ag5aJ1KjobH7yf99GeCsFOqx7iZJFvPfTbu5jihpG7I o2dacIG46uXCzaSN4aO5j0CkGbBaxlXGX9YUbXBexEiIDNVymTciNUaKrfxKVLzMsncR snnWaEKr6jhStNdBI7P5mlDmBbR2KbiNsjoB1uGMKpHOIn42/wbfRwJVNJMpCD+W8kmM rAUjCe9ELyu/LfbT29Oq5FIAXHa6OMpWYBnE6dPRS0vOgVbwbWKo/acJjP7daCnlA2WQ Bz6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784626785; x=1785231585; h=content-type:mime-version:user-agent:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=dtOgYuYcINt4rQ64xSupB84lDJG4RYkc7bUPyFnH3DE=; b=imNgD24ptcIrcJqEb2+8c6Ev/A7UVnY5juCeI81Q9s2zf5TkCORB/ji/ynI+l90ZsQ m9H2rpRzZiVAF/FzYgxQ8WYHcmEGRar+Zd7RaPdJ3lOI92UsdkV3zhvQS++biHpugHiD Flnz4IuHM8uQzplAYp/tuU424o2P+nICXMgCeLTG4W3tqo62PX7QcOrFGOkbB6oex9/V 9/afzOZGR9d9Udfl4SbZ44aJnmKE+wVy9lqAqKw2WF9y/YKyaoYH8chBsuMixeYvef6d OO6/BnRrHpY/NtruUjHf9es15i2Vw+n6D6dwpztNM5xGGSybByw+vpfZcCriY13kbmtg sB4A== X-Forwarded-Encrypted: i=1; AHgh+Rp9h2PjMnRpKuXKq54qSbol878heg8TFoTHVNP5COloRPneSoXENIb2vJofHYGKXPHvnPBREspNNby38D8D@lists.postgresql.org X-Gm-Message-State: AOJu0YwRWhpRuJGKuZHtoC2yhai4pIhYtKwbn3xBfw+2mTBGqC7fhHAB wAdr86mbxtywyuXMF6abBrasWNtSo4pUNlniv2Eei/OwesE0aagQt3Y= X-Gm-Gg: AfdE7cn+uCBTVSjCmAxbOBC6lRaW9MMZfcHtiFFRkYzjR4+4dKVhkIv/Bq5hvn2KnaJ 01UZw5P83Sg9tH/Outmc2VDw5YjcdSSmknqfJPJC6rAMcdbEM/rnwFX1qN/675wLgUBnXpMSmJG uKeSNzpN8Z0s99tzCZgndA0uIg6eGeGPgu3mS4fV/fi040qN3by6U+47uwXT2M6GwweBnd3vtYV hXd3IZoEOWj1Oavvetr2xZwqbf+vUY6dOD8KHM4NHkZ4Z/lS3yRYf0myeCq+UukTPo3l14JVrgE aFntbamC3FeDzKXQH+/W5JL0EB2nbZerctOUM1bHJ6Zcv6TD9V061LDJKo5DMTekgb0D9pTte3L xkT23EHXH4ffoKDCZGIYTeJ0GeDvDhNFZDPnJVBhPp4SIui3GyK/4XrODdc9b2inRI9bPqC3xK+ inAzngBcRv3p8j1g66Xw== X-Received: by 2002:a17:907:db02:b0:c16:652c:3db7 with SMTP id a640c23a62f3a-c16b47818bdmr682819166b.36.1784626784436; Tue, 21 Jul 2026 02:39:44 -0700 (PDT) Received: from localhost ([2a00:6d43:908:5803::3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1712a63b41sm562812766b.29.2026.07.21.02.39.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 02:39:43 -0700 (PDT) From: "Jonathan Gonzalez V." To: Alvaro Herrera Cc: Chao Li , Euler Taveira , japin , Andres Freund , pgsql-hackers@lists.postgresql.org Subject: Re: log_min_messages per backend type In-Reply-To: (Alvaro Herrera's message of "Mon, 20 Jul 2026 14:15:36 +0200") References: Date: Tue, 21 Jul 2026 11:39:41 +0200 Message-ID: <87bjc0heaq.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello! Alvaro Herrera writes: > Hello, > > Here's a couple of trivial cleanups of this code. 0001 simplifies code > and removes a duplicate by creating a small subroutine; 0002 also > simplifies memory freeing a tad, by freeing allocations as soon as > no longer needed instead of waiting and being forced to duplicate the > frees in several places. > > This is two commits here just for ease of review, but I'd probably push > as one commit (and without backpatch). The first commit passed without problems and works like a charm, but the second one is breaking the detection of the messages here: @@ -2392,6 +2393,8 @@ check_log_min_messages(char **newval, void **extra, GucSource source) guc_free(rawstring); return false; } + rawstring_len = strlen(rawstring); + guc_free(rawstring); The rawstring is being reference in the elemlist, so the free is making the string empty when is going to be used later: (gdb) print rawstring $17 = 0x555556f85e08 "" (gdb) print *elemlist->elements $18 = { ptr_value = 0x555556f85e08, int_value = 1459117576, oid_value = 1459117576, xid_value = 1459117576 } Regards! -- Jonathan Gonzalez V. EDB https://www.enterprisedb.com