Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIciz-0002Wr-Gj for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 17:27:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIciy-0000nl-7U for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Apr 2019 17:27:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIcix-0000iS-QV for pgsql-hackers@lists.postgresql.org; Mon, 22 Apr 2019 17:27:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIciv-0004Do-KO for pgsql-hackers@postgresql.org; Mon, 22 Apr 2019 17:27:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3MHRHJH018605; Mon, 22 Apr 2019 13:27:17 -0400 From: Tom Lane To: Andres Freund cc: Alvaro Herrera , Michael Paquier , Justin Pryzby , pgsql-hackers@postgresql.org Subject: Re: clean up docs for v12 In-reply-to: <20190422165324.iyduznrdspcia7ja@alap3.anarazel.de> References: <20190422161955.GA17411@alvherre.pgsql> <16490.1555950804@sss.pgh.pa.us> <20190422164356.7d63s4bui3735r3q@alap3.anarazel.de> <20190422165324.iyduznrdspcia7ja@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 22 Apr 2019 09:53:24 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18603.1555954037.1@sss.pgh.pa.us> Date: Mon, 22 Apr 2019 13:27:17 -0400 Message-ID: <18604.1555954037@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > The computation of that variable above has: > * If the column is possibly missing, we can't rely on its (or > * subsequent) NOT NULL constraints to indicate minimum attributes in > * the tuple, so stop here. > */ > if (att->atthasmissing) > break; BTW, why do we have to stop? ISTM that a not-null column without atthasmissing is enough to prove this, regardless of the state of prior columns. (This is assuming that you trust attnotnull for this, which as I said I don't, but that's not relevant to this question.) I wonder also if it wouldn't be smart to explicitly check that the "guaranteeing" column is not attisdropped. > I think just reformulating that to something like > /* > * Check if it's guaranteed that all the desired attributes are available > * in the tuple (but still possibly NULL), by dint of either the last > * to-be-deformed column being NOT NULL, or subsequent ones not accessed > * here being NOT NULL. If that's not guaranteed the tuple headers natt's > * has to be checked, and missing attributes potentially have to be > * fetched (using slot_getmissingattrs(). > */ > should make that clearer? OK by me. regards, tom lane