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 1w7hHv-005bbO-0e for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 22:10:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7hHt-00DSAg-29 for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 22:10:18 +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 1w7hHt-00DSAY-1H for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 22:10:17 +0000 Received: from mail-vk1-xa32.google.com ([2607:f8b0:4864:20::a32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7hHq-00000002FVU-3QIJ for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 22:10:17 +0000 Received: by mail-vk1-xa32.google.com with SMTP id 71dfb90a1353d-56a9076813bso3183376e0c.3 for ; Tue, 31 Mar 2026 15:10:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774995014; x=1775599814; darn=lists.postgresql.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7HjoLQmOY8rZDpQOb9XExTQH4Gb8lDAi4Q5AqJjZipU=; b=snhM+y7hB0HwwTUSzXDOnPCcdCx5ztLjeLzSOr/8TF0UWaCCvc5RZkfK11SmLK+441 GXeh0DIFxj8dOb6Bk+W0A0Rj6qhP6Q57Aqkbi3pnCwRdPsBgXLH3/W3aXLhMfbSXUiom liunuyCLWxuwDNtUp63bHL0y2dEDcuXK14oa4xqoKxJHLa7LUB4+puujkJH0KAGEIS8+ xI7AyFWLQ4c24HBrdYQvYOGMOAE0i0nQ+fK0AmInap+EtmmR5IrnCAmbo77tSkArKhSp wwDu5DckbD2hww0RP/yRh4ZL8a3/XkgtuP0XLoSlU/zoMTb6rx+Hh4u6ug3r2MPywzMi xCaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774995014; x=1775599814; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7HjoLQmOY8rZDpQOb9XExTQH4Gb8lDAi4Q5AqJjZipU=; b=JjLOfXO5Ra3JoKkU7FlZugKt8bdLzjOTvq2Ysix3i/zpZGvJgRUr7SRNXJh7lwMk0R VOc6HHZtu/I52bM2GEHXBwTjmn0Pc67NHBbMjGYHMfCpSjel/zPHWZgFId2ATFzDSTIu Jw8KEpSn+DJSdUHhDfQ7nTBS+AruXmm8cWwHV9a6uIPc5TuS4LnxlzQ6CSxgOX5pqwbF oGjckxIFloPB4c4Oq22TNQnni+wUQsTLSxer2Ek24+najgf0jLNVxMYIxI8FQouWQnC0 4XvC4mP9N3sVbFZwJIgp6Avk9M1Hdmi5ju//st1uBJiWKKAnSMWi6tdvQvgF7a3VEyMU KeZA== X-Gm-Message-State: AOJu0YyOPekvMulTQBuSUn5ZfipgrzXHxxaukzGkEtqwjRkNkyG4fLDL TMygZCcfxxBvAjiPU3nzTUPUNab5A8Cfvo/gZiAPj0XM0uMJtuTdSFdysUGkVg== X-Gm-Gg: ATEYQzziLzTI2x6toLh1jBRIXoFp5Tarjhw//F7hJjRdLE2u7ToB6pOvHZrcIt5Uhsj uIXBzP4wRei1Ar9wCyI48JPTAJuSO49Qnf87OBTf/gvcIKPfXipyTZAqui1DtnZPyqUCrI9JtM1 XuxoLdb1pSTKEyGRhNceUNh4Y18IPUcRSsyuEfJZ1mev+cYWakwbJgKDm1ycHrn8px6bS5AF4dN Jm+aRPNG54hJNvT5ukYlplTcPr2xseY/d+fo40NwQLsY0lJQ+zZdP3BEs0/Uzry0OYzV/2CXWUw pHB3PlAWu2Waaxab8xl0Hzf02xb5bFC0R9OYThgowHDd8od1SDdpj9a6W2LC+anmH2culLXU+Z2 I0Vu7OR9UL9nDmijlSjOyD2IxRieDu/V/Q6yuBy7dpTQLUVqcDOlTjk6BFBSbn+lhBMaejqgq0G 8WBb+pWEjkHvwdGXGRes5SrvlsLuXXubzRKofp8lGc+mK0SQ== X-Received: by 2002:a05:6122:e67:b0:56b:6d6b:df3a with SMTP id 71dfb90a1353d-56d8a7b8778mr531739e0c.2.1774995013499; Tue, 31 Mar 2026 15:10:13 -0700 (PDT) Received: from localhost ([2804:14d:328a:a59c:f937:7936:85d2:4fab]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-56d589f9c0esm13831383e0c.9.2026.03.31.15.10.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Mar 2026 15:10:13 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 31 Mar 2026 19:10:08 -0300 Message-Id: Cc: , "Lukas Fittl" , "Tom Lane" Subject: Re: Add custom EXPLAIN options support to auto_explain From: "Matheus Alcantara" To: "Robert Haas" X-Mailer: aerc 0.21.0 References: In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue Mar 31, 2026 at 1:18 PM -03, Robert Haas wrote: > On Mon, Mar 30, 2026 at 5:49=E2=80=AFPM Robert Haas wrote: >> I'm currently poking at some ideas for fixing this... more soon. > > Here are some patches. I got started poking at this in earnest > because, on the pg_plan_advice thread, Lukas was saying that instead > of adopting pg_collect_advice, we should just add an option to send > advice strings for each executed query to the server log. I went to > implement that and then felt like it should really be part of > auto_explain rather than its own thing, which took me down a bit of a > rathole. But I eventually found my way back out of it, so here's a > patch set implementing auto_explain.log_extension_options. > > ... > > So I ended up with this: > > ... > > Thoughts? Hi, thanks for the patches. I think that the architecture is much better now. For 0001 I don't have any comment, it looks good to me. The 0002 also looks good, just a typo on "thent" on commit message. Some comments on 0003: + else if (opt->type =3D=3D T_Integer) + arg =3D (Node *) makeInteger(strtol(opt->value, NULL, 0)); I think that we are safe against overflow because on auto_explain_split_options() it has intval =3D=3D (int) intval, but I'm wondering if it's worth documenting this? ----- extension_options is being added to REGRESS in both Makefile and meson.build, but the actual test files are not included. ----- + an associated value. The module that provides the + EXPLAIN option, such as + pg_plan_advice or + pg_overexplain, + should be loaded before this parameter is set. Wondering if this is clear enough about the shared_preload_libraries order (auto_explain should be loaded after extensions that include explain options) or if we should mention this explicitly. -- Matheus Alcantara EDB: https://www.enterprisedb.com