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 1vTWAn-003fnJ-2g for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 02:12:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vTW9n-001uf2-0e for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 02:11:51 +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 1vTW9m-001ueu-2i for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 02:11:51 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vTW9k-00059F-1q for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 02:11:51 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-7bc0cd6a13aso315628b3a.0 for ; Wed, 10 Dec 2025 18:11:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765419106; x=1766023906; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=16iKf9cOVOAQSIOeMFo0/VM6JOnqk9uiikWDgeayzFQ=; b=FMFhUtEuMJJ7eA7q2Llo19wir6suWFNR3hci3S7Ns/jdYFx7a+Is2RluJoyvrfZLRJ vizVxICdZPk6gUl8HSsH9FA35dkV2f4obsOe1ob2cl6ML843q3tvU+NO4iRiyVELWQC4 e+/AQ0dzOKZRCa41Ess4cEjsOxRRozjYS52HQYsmWq7ubN83fsWmsp6qkskWKL0KYYzn odfltWixvqqLooX0GObfv9fvQ66auoJItFR0A+3IlyRezRpqLDhO0iC6F/tZRESrHv8y CCPCLA113Cqt94BISf3ZW3ZmOo7S+ogiE6j3zmbFwZKlsXmpKySblvnyO0e48NyAiREV X3Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765419106; x=1766023906; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=16iKf9cOVOAQSIOeMFo0/VM6JOnqk9uiikWDgeayzFQ=; b=kvJfr54x8k9x//OHthgADYf9PLsXWCjgHaEMLGwKUumDy5wptDLlFS0enRRP8UNcX1 0P4gN5pNGGvpTGMa5NtRcrWSMIpY5TfGb7b8mO4uzB/uMbxHBQueRW1LgIR8POnjXmTz zcQtWoaY4BmdBpsmXGBuGc7dYSP4avacmLBMCWlZdx5bcr/tZ9YtqN9VQPFjwpu/TdqX i8SY9op1CR+jN1XKp98drkf3hHY7zg3lLMA1XCIKnzjAnf5lUvCtTDcJiLOrT3q0jw1B cI2hOqy+pEPfOdio0cERO/HCoSlWzgPJEvZKP+ojv2cfcJ5FjyK1L1dyHeH34b3gG0xN vz2A== X-Forwarded-Encrypted: i=1; AJvYcCUsgd9KQWd/y4saKJodAhNo5i+6v0+ZuUPxh0AFBD3OLoplYddfTM3EpPdPnQ8GGys7osQXefFRkGhH5yoj@lists.postgresql.org X-Gm-Message-State: AOJu0YxbKytdNGcQF8qG5jWkZmqpY5+WDkh/TkE3sPhvV6Ku7PFvdK4H ynb/NuWYO8ucF08FMtNIXVU5w+9FAikRkWWZX1hrv0c+BxOsX/p2HFM7 X-Gm-Gg: AY/fxX5ZorkTkmyu3g1yjdbFh9QM1h/sWsHV64FIbJ16TM0NoBzM+ajeM1x4ocKIXbT wyqq5a1k13tO1a0x+1YWxF6j/DQ7eTTGBvYKbKKSMUyvEo1Z+UX4IIMLIrioBzIla2Kbc6mcbN5 Eq2VrAGU8ll9Pyt5o5TAFd3aIQGn4FtFYbmQ2jEiolEZyF5Bz8j1qynTF8Xpd2BRBlVyGcoOnq9 KEACHviHSg7PLTEVNXnnx9mt67KpDi9QA+QpZhY4vTNMWxOGNpm81vxQYH2u97XWAbndnd11A+W qmDcS6V65Da7AicE/AMsJXdo/04JNcmDZW9/ROX73oyRxoDY414wX5qzJmG2CwgvKj+TsI+AjZ0 fB3Dd307cHXexkjuWLhKgDb6e5H84Woj1KEXdgAXGbwDFapLKLCnyYo2zXqn78/BBLn+HfVctOE LlrNHMsW/JM3KlBA6pNtU= X-Google-Smtp-Source: AGHT+IEz+3kb6gDNSiC6JCuG/0N7o/cfOTCiSie0reVi7KpX9d6rwKR1lLmQNz7U/uvAgWUvB/fzag== X-Received: by 2002:a05:6a00:244b:b0:772:2988:31d8 with SMTP id d2e1a72fcca58-7f521620207mr501557b3a.2.1765419106053; Wed, 10 Dec 2025 18:11:46 -0800 (PST) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7f4c547ce23sm751764b3a.58.2025.12.10.18.11.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Dec 2025 18:11:45 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: log_min_messages per backend type From: Chao Li In-Reply-To: <3d0af6b2-15d1-4f38-9881-df964ba0a89b@app.fastmail.com> Date: Thu, 11 Dec 2025 10:11:05 +0800 Cc: Alvaro Herrera , japin , Andres Freund , pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <83347D77-0FD1-4A16-B026-013E0C9F2A4C@gmail.com> References: <202512091806.bsugq2l4wz7f@alvherre.pgsql> <1130A10B-E7AE-49F3-9E13-2CD69B3F9DFD@gmail.com> <3d0af6b2-15d1-4f38-9881-df964ba0a89b@app.fastmail.com> To: Euler Taveira X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 11, 2025, at 09:57, Euler Taveira wrote: >=20 >=20 >> In the =E2=80=9Cif=E2=80=9D and =E2=80=9Celse=E2=80=9D clauses, there = are duplicate code to valid log=20 >> levels. We should refactor the code to avoid the duplication. For=20 >> example, pull up =E2=80=9Cloglevel=E2=80=9D to the =E2=80=9Cfor=E2=80=9D= loop level, then we can valid=20 >> it after the =E2=80=9Cif-else=E2=80=9D. >>=20 >=20 > The for loop is duplicate but if you create a separate function for it = but the > result is: >=20 > src/backend/commands/variable.c | 43 = ++++++++++++++++++++++--------------------- > 1 file changed, 22 insertions(+), 21 deletions(-) >=20 >=20 I don=E2=80=99t think we need to add a separate function. We can use = =E2=80=98if-else=E2=80=9D to parse log level, then verify it after = =E2=80=9Cif-else=E2=80=9D. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/