Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJwJj-0004Kl-F6 for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Jun 2017 06:25:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJwJi-00042O-LX for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Jun 2017 06:25:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dJwJi-00042F-2M for pgsql-hackers@postgresql.org; Sun, 11 Jun 2017 06:25:42 +0000 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dJwJY-0005y3-K0 for pgsql-hackers@postgresql.org; Sun, 11 Jun 2017 06:25:40 +0000 Received: by mail-pf0-x234.google.com with SMTP id x63so41146706pff.3 for ; Sat, 10 Jun 2017 23:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=73rdG5zO6fMOIl68ZgMZf9SpzN3W1+OHqJpIqci/iOg=; b=OEWHnWDK7lQJ8fHOzGMjHARNy+dg00mPTME+AVcdDl4MwWSXoxKTXObuC9oMFSkmRR 8ltd3Q9ZFx9AsSUUY1434FBX3I0Oq8rHXeOPcSj12ytfH2bA8JQ4z4IBPQ27511qqej6 55n/JDdA3jPgbf7jJWVIku32uO9AFGZmD1lRo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=73rdG5zO6fMOIl68ZgMZf9SpzN3W1+OHqJpIqci/iOg=; b=m51C4ELYwqoKDLoFQ0c6dPdaYRjmxPv5JKiAVIH3CBqD9lxUzMGwfwxlT+Wlnl1CfD XrpONfcyr/7djz0kYz8HME3tDTXIN3mzN8NQuZJLOMsT4sgIKcFxwOpkevWoRWJ9GwBj LtrVWPhqn73LMgOxFJ5TF3ty0C7NmsyEPFjvT+eindph0NUs+Ws8hn5ewqmqTIDI0Id/ 3znSW/3gad7R9E1rvjfevsLOYbR/xMlzAC2wZXsn+nxOXTb2frCeOjcph2B8ar59jCMo I+g7nQrVkpHTQQ6J7Dm7gMlW9cNHt9FUSrcso3ABUjkGZF+990yuFflc5sNGsMk0VBaS Hugg== X-Gm-Message-State: AODbwcCiaxQGQi56Whi5nJTbdkX2dAldvgvaWjvOrPEXq7DsKgdBN7sc FFhDf6fXXu5o6DA2 X-Received: by 10.84.224.5 with SMTP id r5mr50754604plj.267.1497162329045; Sat, 10 Jun 2017 23:25:29 -0700 (PDT) Received: from rfd.leadboat.com (c-73-158-248-138.hsd1.ca.comcast.net. [73.158.248.138]) by smtp.gmail.com with ESMTPSA id k193sm10620070pge.43.2017.06.10.23.25.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Jun 2017 23:25:27 -0700 (PDT) Date: Sat, 10 Jun 2017 23:25:25 -0700 From: Noah Misch To: kgrittn@gmail.com, thomas.munro@enterprisedb.com Cc: pgsql-hackers@postgresql.org Subject: RTE_NAMEDTUPLESTORE, enrtuples and comments Message-ID: <20170611062525.GA1628882@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org While completing my annual src/backend/nodes/*funcs.c audit, I noticed defects in commit 18ce3a4 changes to RangeTblEntry: 1. Field relid is under a comment saying it is valid for RTE_RELATION only. Fields coltypes, coltypmods and colcollations are under a comment saying they are valid for RTE_VALUES and RTE_CTE only. But _outRangeTblEntry() treats all of the above as valid for RTE_NAMEDTUPLESTORE. Which is right? 2. New fields enrname and enrtuples are set only for RTE_NAMEDTUPLESTORE, yet they're under the comment for RTE_VALUES and RTE_CTE. This pair needs its own comment. 3. Each of _{copy,equal,out,read}RangeTblEntry() silently ignores enrtuples. _equalRangeTblEntry() ignores enrname, too. In each case, the function should either use the field or have a comment to note that skipping the field is intentional. Which should it be? This fourth point is not necessarily a defect: I wonder if RangeTblEntry is the right place for enrtuples. It's a concept regularly seen in planner data structures but not otherwise seen at parse tree level. nm -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers