Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8tJe-0002qz-Uc for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Jul 2022 00:54:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o8tJd-0007GN-I8 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Jul 2022 00:54:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8tJd-0007GD-92 for pgsql-hackers@lists.postgresql.org; Wed, 06 Jul 2022 00:54:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8tJZ-0000mA-Fm for pgsql-hackers@postgresql.org; Wed, 06 Jul 2022 00:54:52 +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 2660skXD2052983; Tue, 5 Jul 2022 20:54:46 -0400 From: Tom Lane To: Peter Eisentraut cc: David Rowley , pgsql-hackers Subject: Re: automatically generating node support functions In-reply-to: <1593978.1656953960@sss.pgh.pa.us> References: <2f876203-7142-fa71-6d22-6ce00eb26869@enterprisedb.com> <50fedc80-4104-bdc8-d777-04f030fc550f@dunslane.net> <7848b872-7a10-67b2-b55f-7c9c475ae863@enterprisedb.com> <40a2e977-98ba-0c01-af6c-9dfb39e864ba@enterprisedb.com> <812ea8eb-6827-ba32-6ec0-6714f7ffa5dd@enterprisedb.com> <2905876.1644858587@sss.pgh.pa.us> <968928d9-a526-a1b5-dc36-0355632a843e@enterprisedb.com> <1294462.1656875649@sss.pgh.pa.us> <57df9f30-d2cf-9126-28d4-ae40a2e733a9@enterprisedb.com> <1593978.1656953960@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 04 Jul 2022 12:59:20 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2052981.1657068886.1@sss.pgh.pa.us> Date: Tue, 05 Jul 2022 20:54:46 -0400 Message-ID: <2052982.1657068886@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ... BTW, I thought of a consideration that we probably need some answer for. As far as I can see, the patch assigns NodeTag values sequentially in the order it sees the struct declarations in the input files; an order that doesn't have a lot to do with our past practice. The problem with that is that it's next door to impossible to control the tag value assigned to any one struct. During normal development that's not a big deal, but what if we need to add a node struct in a released branch? As nodes.h observes already, * Note that inserting or deleting node types changes the numbers of other * node types later in the list. This is no problem during development, since * the node numbers are never stored on disk. But don't do it in a released * branch, because that would represent an ABI break for extensions. We used to have the option of sticking new nodetags at the end of the list in this situation, but we won't anymore. It might be enough to invent a struct-level attribute allowing manual assignment of node tags, ie typedef struct MyNewNode pg_node_attr(nodetag=466) where it'd be the programmer's responsibility to pick a nonconflicting tag number. We'd only ever use that in ABI-frozen branches, so manual assignment of the tag value should be workable. Anyway, this isn't something we have to have before committing, but I think we're going to need it at some point. regards, tom lane