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 1w9pbt-001nYv-2h for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 19:27:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9pbs-00BSeK-04 for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2026 19:27:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w9pbr-00BSeC-27 for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 19:27:44 +0000 Received: from mail-vk1-xa35.google.com ([2607:f8b0:4864:20::a35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w9pbp-00000000u8V-2vie for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2026 19:27:42 +0000 Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-56adf76631cso1637879e0c.1 for ; Mon, 06 Apr 2026 12:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775503661; x=1776108461; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:fcc:content-language :references:user-agent:mime-version:cc:to:from:subject:message-id :date:from:to:cc:subject:date:message-id:reply-to; bh=f6k0hfQXPpK2sUdbSO/OUIpwtL09jYIk1hEfZZkOLiY=; b=cRRVr1QCWoDcpBoniKALyhvltNIHNES4Yq8c1517fGz3sPSNuBcnrWbXkQHij9spvh dpTibRX5cYP/S4nUamtAhOFjumzJu0wEX1b/qn5XtRuV4GPv3P0nYsRze9xdzAIurM7+ aefVOgGKAcYNvA1o3IGB94hjCvIeWetmCMvftGWsnpT18zpI5ckj36V4TY8EjTOvSwdJ iNlvq5jC6gNXYUm2Wgy4gQxWcWpU9FV9E+uP1kjNI2Lgu10oijkcDazU93H2+wxMrLOX FIkVFFGv51LS28t6vD52UyrkZCQEREBa7qqGTQdGLxsuhuJA2piR6fBFrlxjvKHHo0gr ITXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775503661; x=1776108461; h=content-transfer-encoding:in-reply-to:fcc:content-language :references:user-agent:mime-version:cc:to:from:subject:message-id :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f6k0hfQXPpK2sUdbSO/OUIpwtL09jYIk1hEfZZkOLiY=; b=qbOe5fLaNA0H8c5HDJPV4ntKq5NeR84CY2HC2JIse2YLDcIQbA4QWsYMNOT9+KpFxb RjGh1LGWa9OiShBk0ISmtIwPoZ6HeUDtF/mX3lJ7OFl3AXhzaEJKwxX6gYuOs01yO2E9 6zsiv9VWWlZIQbbbfxps0QAuboWSurePCBBnwKOfp+kMZScW5m2CFWK0ijfVgHmBaGNX QsL+zLuCLvP8KUcYq2UnZhDQBZsXwYO1WaMHOoRbnDNfLinmOXc8y3qVsUCY97rBQbSa 53yHZ+uHay8uwVSylfCGV8qu9jTcgVBqAKImYFhu6vhE/dd2hhjFA9VA5zhPeqfOZszV GpoQ== X-Gm-Message-State: AOJu0YzCp/1wLCs2TrTC2bS59NLx31iRdc0Act+ACJMYayEp5BlWrJfk uTpuvQqfIsLs46AJN6dLd2/Q2AhzR/vJQLKfA15IRtlDXZ2FPlj9tOhs X-Gm-Gg: AeBDieufOYyHpjDMQkr+u9CKg40R5FQ+cMf7JIcVxEVXDRUSws2xLJKOW2HGH3uVkyf 8LNV6EZ9SiHkq7pSkY/+XMlzBShgVwbCcSq1KYfoGKM3A2V2bVNPLI63woCoBXBfqJyJPFmScRI M451b/Piykpb9y+B7aFEEa4ywV4CmV8Al2wQJfo5j854M8Z2jf/gFH6lhv0GJ1g5F8lffzXrodV 2WdDsEcE5uAK0ss3PFLZaftSdwImf0CGLNNI/fXNpxeKeILrT5iAMryDsjs9fZfcELhY6Rh4fF8 dgkEZ6f0VjTPAvd2rv5xzxQx/j97j4rQAypFUlFcGe24BukhqwfGm4TYN2OeVKDGKxfKHasGqom JLejntqIjLPrnZPwDXkgVBaYPy38YXijmsRuUDJBGIpis5Rh2szm715nizjBF4tu0a+TJ6TxE9n qjCM6x7jnzWBh1dvPksvI7m5TXoXGStVUEGsmtrnyvx7GLxg== X-Received: by 2002:a05:6122:e1b2:b0:56c:ce0b:fecd with SMTP id 71dfb90a1353d-56dab9d6df7mr4834923e0c.12.1775503660883; Mon, 06 Apr 2026 12:27:40 -0700 (PDT) Received: from localhost ([2804:14d:328a:a59c:2593:23d3:4374:36cc]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-56d9ba826f6sm17202244e0c.2.2026.04.06.12.27.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Apr 2026 12:27:40 -0700 (PDT) Content-Type: text/plain; charset=UTF-8 Date: Mon, 06 Apr 2026 16:27:37 -0300 Message-Id: Subject: Re: Add custom EXPLAIN options support to auto_explain From: "Matheus Alcantara" To: "Lukas Fittl" , "Robert Haas" Cc: , "Tom Lane" MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: Content-Language: en-US X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0; attachmentreminder=0; deliveryformat=1 X-Identity-Key: id3 Fcc: imap://matheusssilv97%40gmail.com@imap.gmail.com/[Gmail]/Sent Mail In-Reply-To: Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 03/04/26 23:09, Lukas Fittl wrote: >> +static int >> +auto_explain_split_options(char *rawstring, auto_explain_option *options, >> + int maxoptions, char **errmsg) >> +{ > > I think this function probably has the most complexity due to its > hand-rolled parsing, so it might be good if someone else takes another > close look at it. > > FWIW, I couldn't find anything wrong from a first read. > > Otherwise 0003 looks good to me. > I did another review of 0003 (0001 and 0002 are now committed), focusing on auto_explain_split_options(). I didn't find any issues. The code coverage looks good - auto_explain_split_options() has nearly 100% coverage and the new code paths are well exercised by the tests. Regarding the shared_preload_libraries ordering concern: I don't think there's much we can do from the GUC perspective, I mean, we're essentially building an extension dependency chain when auto_explain.log_extension_options references options from other extensions. If I configure the GUC with 'plan_advice', I need to ensure pg_plan_advice is loaded before auto_explain. The documentation makes this clear. My concern is about that some cloud providers expose shared_preload_libraries as a dropdown without user control over ordering. I can be totally wrong, but it seems to me that in this case, the provider would need to handle dependencies appropriately or have a way to let the user define the ordering. Or, a possible improvement would be a post-configuration validation hook that runs after all shared_preload_libraries are loaded, allowing deferred validation of cross-extension dependencies like these EXPLAIN options (I'm wondering that we can have more extension dependencies in the future, e.g plan_advice and pg_stat_statements [1]) That said, I think we should proceed with 0003 as-is and revisit this when real-world usage reveals such problems in practice. [1] https://www.postgresql.org/message-id/CA%2BTgmobtbB74PTUtCQwUNR8D9ZZwKH5ZptoU30ONm34TR954Nw%40mail.gmail.com -- Matheus Alcantara EDB: https://www.enterprisedb.com