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 1rb4wh-00D2ya-U1 for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Feb 2024 20:36:32 +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 1rb4wg-004K5R-JA for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Feb 2024 20:36:30 +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 1rb4wg-004K5I-4f for pgsql-hackers@lists.postgresql.org; Fri, 16 Feb 2024 20:36:30 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rb4wd-0076Zw-Ht for pgsql-hackers@lists.postgresql.org; Fri, 16 Feb 2024 20:36:28 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-364f791a428so7453105ab.3 for ; Fri, 16 Feb 2024 12:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illuminatedcomputing-com.20230601.gappssmtp.com; s=20230601; t=1708115786; x=1708720586; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1ujtc8aBn+xpGJ22RmBncQaNoOlYgYj6c4hwUOKjIt0=; b=xnlAwWdhGM7nCDTMlLgL2nTP11LXyDCHaXQds5cwZALVjibO2mK8lEQo/WMIWYjxwC ay52z8+hiK/GE2zx1j7Lrx38ObNHCf2rESbCFGKVd559f2zKR1ujMW3guC/U8nz4/mPP uHcCFDXyDgNXD2w5PJcka3xI8UgUaTaCi6Vbqt8AdcamYn0FDXn3b4V0pVUy8Teup5na 0D1NkFT7qnzknKi0mvpQCcn3L1F8El+WN2/dgPmNfMmda4K2AaAdjZkH8DSVA4pLwHHD yQ94plmtmcPTLius4wBwm7bGlq8GIw+uPAlSVid4+992Dtq4BjZ/Fz3DIqRM/tjoSpRW cozg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708115786; x=1708720586; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1ujtc8aBn+xpGJ22RmBncQaNoOlYgYj6c4hwUOKjIt0=; b=E6OU0Y4vzgvAaYGx+gi8Q7QxWYlJ7fDct6OxfJJbi4TAv1f08JiPEogbtIRCfi+nT+ iHE56cl+kd/RDqpAi5FM2IRWjNovh0qyPuTeba3WXHwK2vXdA398MBs+DfhdUwfz1P5K 0uZt0qze16BJfMDfi/KOKsJ2gjiFLZLnr1I8cez3zwSXXg4PcPtZt/1elPG5LLz3kV/k tgkgv7EKlHdzBpofhHorhaUnh3g7wNoPz5KVUDpbTtLIE2yjfJlhT9b2vK6ORvwQfoSL 0KVFAgfM7ovT+xZNNZHY4AWdQYSPeo9ONUha1KFs6ZUPVIsZ9G0KXY4x9l/iTsdvsnnS WbdA== X-Gm-Message-State: AOJu0YyC4aZLxJFy3JUev4hyJl6vROWD9LPSsDoiP55i/fu+JZVOs5dd ReH3S5tmI4LaPT7wE7vqhy3LW5dI3ylwPug6LMoGmgnkXqQ4N4VCYgwNQxviSdODtJNAGv+GO/m x X-Google-Smtp-Source: AGHT+IHGRhvGrI9E2S1icTU5s+8B+CCQV8qQpMuDcVpBXh3Rp2IbW9Ttq3poakUdFWqH4ycXZuuAhg== X-Received: by 2002:a92:dad0:0:b0:363:c9ec:cf02 with SMTP id o16-20020a92dad0000000b00363c9eccf02mr5709017ilq.13.1708115785969; Fri, 16 Feb 2024 12:36:25 -0800 (PST) Received: from [192.168.2.139] ([50.53.98.191]) by smtp.googlemail.com with ESMTPSA id t20-20020a632254000000b005cfbf96c733sm317874pgm.30.2024.02.16.12.36.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Feb 2024 12:36:25 -0800 (PST) Message-ID: <9818bd29-3eff-40c5-ad6a-8d89ba8c7acc@illuminatedcomputing.com> Date: Fri, 16 Feb 2024 12:36:24 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: automating RangeTblEntry node support Content-Language: en-US To: pgsql-hackers@lists.postgresql.org References: <4b27fc50-8cd6-46f5-ab20-88dbaadca645@eisentraut.org> <859d6155-e361-4a05-8db3-4aa1f007ff28@eisentraut.org> From: Paul Jungwirth In-Reply-To: <859d6155-e361-4a05-8db3-4aa1f007ff28@eisentraut.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/15/24 02:37, Peter Eisentraut wrote: > In this updated patch set, I have also added the treatment of the Constraint type.  (I also noted > that the manual read/write functions for the Constraint type are out-of-sync again, so simplifying > this would be really helpful.)  I have also added commit messages to each patch. > > The way I have re-ordered the patch series now, I think patches 0001 through 0003 are candidates for > inclusion after review, patch 0004 still needs a bit more analysis and testing, as described therein. I had to apply the first patch by hand (on 9f13376396), so this looks due for a rebase. Patches 2-4 applied fine. Compiles & passes tests after each patch. The overall idea seems like a good improvement to me. A few remarks about cleaning up the RangeTblEntry comments: After the fourth patch we have a "Fields valid in all RTEs" comment twice in the struct, once at the top and once at the bottom. It's fine IMO but maybe the second could be "More fields valid in all RTEs"? The new order of fields in RangleTblEntry matches the intro comment, which seems like another small benefit. It seems like we are moving away from ever putting RTEKind-specific fields into a union as suggested by the FIXME comment here. It was written in 2002. Is it time to remove it? This now needs to say "above" not "below": /* * join_using_alias is an alias clause attached directly to JOIN/USING. It * is different from the alias field (below) in that it does not hide the * range variables of the tables being joined. */ Alias *join_using_alias pg_node_attr(query_jumble_ignore); Re bloating the serialization output, we could leave this last patch until after the work on that other thread is done to skip default-valued items. Yours, -- Paul ~{:-) pj@illuminatedcomputing.com