agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: clean up docs for v12
Date: Mon, 22 Apr 2019 13:27:17 -0400
Message-ID: <18604.1555954037@sss.pgh.pa.us> (raw)
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>

Andres Freund <andres@anarazel.de> 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





view thread (40+ messages)  latest in thread

Message-ID: <18604.1555954037@sss.pgh.pa.us>
Permalink:  ../18604.1555954037@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18604.1555954037@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, alvherre@2ndquadrant.com, michael@paquier.xyz, pryzby@telsasoft.com
  Subject: Re: clean up docs for v12
  In-Reply-To: <18604.1555954037@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox