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 1nXVSj-0000Qf-HJ for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Mar 2022 21:57:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXVSi-0006L2-B5 for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Mar 2022 21:57:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXVSi-0006IG-1B for pgsql-hackers@lists.postgresql.org; Thu, 24 Mar 2022 21:57:44 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nXVSf-0001MI-Qu for pgsql-hackers@postgresql.org; Thu, 24 Mar 2022 21:57:42 +0000 Received: by mail-pl1-x62e.google.com with SMTP id q11so6147378pln.11 for ; Thu, 24 Mar 2022 14:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bnmCxQCIEHI/alkZgRkyGo82EGIIxUdzFxmJWQzSSbo=; b=AUy0IqjIqJqT218fFwrEoU3zqeHC+pb0RN6TGzvvWOFKC3qcbYuJJGt7OUNQFM+wKa u+MjJJRe5xo1O6odLfED8VD57uO2gQ2WOSdhnrtgrQMWZoooHP8M+mh+RFazX6spd2wk frcwQ4NjYYmwcimRXx6M4XoPEqAwf64ozPqIV3TdLXt4Jzn3VQ8NZjdXdRNTnREyglev j7akr7dEC/px1S1sDoMXONLMllGSd4aS9QCeLsj/Cmv+z6nRU1RDaPoB2153inPxBVci bm/icGkbiWnGdZdw3msTFb8Vo2Y5yoGc+w9qWfmZVDnIgSa71wB6QzhooKtqkepBYFua IRLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bnmCxQCIEHI/alkZgRkyGo82EGIIxUdzFxmJWQzSSbo=; b=vE1Xm2KxVLd51EVDSwKIvWbBtplnZZI8CuePuCn8mCsWfM2QBiy67Fysx6uX+VuWK5 JXiO899xhsw5uWYDHGdPLEUWZKCG7J5oP0hJzleOSoJshWltzsiEK8r3UjRGWx/cAru8 7sIMpyJkvVBypYAfv3lwQ4M//yx9IsMu3LZ/Of9NrVGg+HGpYnVM4XkOph3+C6FLZfSm TVzmU7YoCq1lAtHWnup95fGvk9VAYozhuQT+ncvfz1B5zY/4/ekwlKlSmnyzCxZ1OMPn 4CutoI3lz1sgltqulMw6XL+tfnrP291lsyWdgOPWEHLgxq/KTvAtNRdlw2Fi0nKDxQUE TyGg== X-Gm-Message-State: AOAM533nDl0MzqcU8X7D/4chHANLqQLfOhvRU2h3Y398NUBFXu0FjHGa HQ2gJi53u8AH6udBq97Jcs4WzgtYr4lbEY6sCcw= X-Google-Smtp-Source: ABdhPJy/9EZsVJmLvtN8yJOBEo4ez1ThSS/vny2E2ybrH5sKZY3npFuXe8dWUQpHgcDnNSiuBLY6Z8SyCncIzydmtBA= X-Received: by 2002:a17:903:32ca:b0:154:7cee:7737 with SMTP id i10-20020a17090332ca00b001547cee7737mr7941580plr.173.1648159060792; Thu, 24 Mar 2022 14:57:40 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: David Rowley Date: Fri, 25 Mar 2022 10:57:29 +1300 Message-ID: Subject: Re: automatically generating node support functions To: Peter Eisentraut Cc: Tom Lane , pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 18 Feb 2022 at 19:52, Peter Eisentraut wrote: > [ v5-0001-Automatically-generate-node-support-functions.patch ] I've been looking over the patch and wondering the best way to move this forward. But first a couple of things I noted down from reading the patch: 1. You're written: * Unknown attributes are ignored. Some additional attributes are used for * special "hack" cases. I think these really should all be documented. If someone needs to use one of these hacks then they're going to need to trawl through Perl code to see if you've implemented something that matches the requirements. I'd personally rather not have to look at the Perl code to find out which attributes I need to use for my new field. I'd bet I'm not the only one. 2. Some of these comment lines have become pretty long after having added the attribute macro. e.g. PlannerInfo *subroot pg_node_attr(readwrite_ignore); /* modified "root" for planning the subquery; not printed, too large, not interesting enough */ I wonder if you'd be better to add a blank line above, then put the comment on its own line, i.e: /* modified "root" for planning the subquery; not printed, too large, not interesting enough */ PlannerInfo *subroot pg_node_attr(readwrite_ignore); 3. My biggest concern with this patch is it introducing some change in behaviour with node copy/equal/read/write. I spent some time in my diff tool comparing the files the Perl script built to the existing code. Unfortunately, that job is pretty hard due to various order changes in the outputted functions. I wonder if it's worth making a pass in master and changing the function order to match what the script outputs so that a proper comparison can be done just before committing the patch. The problem I see is that master is currently a very fast-moving target and a detailed comparison would be much easier to do if the functions were in the same order. I'd be a bit worried that someone might commit something that requires some special behaviour and that commit goes in sometime between when you've done a detailed and when you commit the full patch. Although, perhaps you've just been copying and pasting code into the correct order before comparing, which might be good enough if it's simple enough to do. I've not really done any detailed review of the Perl code. I'm not the best person for that, but I do feel like the important part is making sure the outputted files logically match the existing files. Also, I'm quite keen to see this work make it into v15. Do you think you'll get time to do that? Thanks for working on it. David