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 1tv0gT-00FX6c-Lg for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 21:10:41 +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 1tv0gS-00BpFH-DB for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 21:10:40 +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.94.2) (envelope-from ) id 1tv0gS-00BpF3-3N for pgsql-hackers@lists.postgresql.org; Wed, 19 Mar 2025 21:10:40 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tv0gQ-0000Mn-2A for pgsql-hackers@lists.postgresql.org; Wed, 19 Mar 2025 21:10:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 52JLAWf8815320; Wed, 19 Mar 2025 17:10:32 -0400 From: Tom Lane To: Sami Imseih cc: Andrei Lepikhov , Robert Haas , Jeff Davis , Thom Brown , PostgreSQL Hackers Subject: Re: making EXPLAIN extensible In-reply-to: References: <2234935.1741809008@sss.pgh.pa.us> <2c9376aa-9c66-4662-9803-3d9bc2afead1@gmail.c! om> Comments: In-reply-to Sami Imseih message dated "Wed, 19 Mar 2025 16:51:53 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <815318.1742418632.1@sss.pgh.pa.us> Date: Wed, 19 Mar 2025 17:10:32 -0400 Message-ID: <815319.1742418632@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Sami Imseih writes: >> It would be better to add the parameter "type: EXPLAIN_ONLY | >> ANALYZE_ONLY | BOTH" to the RegisterExtensionExplainOption() routine. >> This value will be saved inside the ExplainExtensionOption structure and >> processed by the core inside the ParseExplainOptionList. > hmm, IIUC, what you are describing is flag that will be limited to > only check if an option can be used with EXPLAIN_ONLY, ANALYZE_ONLY > or both. But what about if I have a case to check against between other > extension options? let's say ExtensionAOptionA and ExtensionAoptionB. > How would that work with the way you are suggesting? More generally, I think that's quite a constricted view of what sorts of checks an extension might need to make. As an example, suppose an extension's option conflicts with "GENERIC_PLAN on" for some reason (perhaps it wants to modify the plan). I think the current hook proposal is fine. It leaves all the validation work to be done by the extension(s), sure, but the amount of code required to handle that one case is tiny, and the door is left open to handle cases we didn't foresee. regards, tom lane