Re: A minor correction in comment in heaptuple.c - Mailing list pgsql-hackers

From Andres Freund
Subject Re: A minor correction in comment in heaptuple.c
Date
Msg-id 20130618090128.GB5646@awork2.anarazel.de
Whole thread Raw
In response to A minor correction in comment in heaptuple.c  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: A minor correction in comment in heaptuple.c  (Amit Langote <amitlangote09@gmail.com>)
Re: A minor correction in comment in heaptuple.c  ("D'Arcy J.M. Cain" <darcy@druid.net>)
List pgsql-hackers
Hi,

On 2013-06-18 17:56:34 +0900, Amit Langote wrote:
> Should it be: "return true if attnum is out of range according to the
> tupdesc" instead of "return NULL if attnum is out of range according
> to the tupdesc" at src/backend/access/common/heaptuple.c: 1345
> 
> /*
>  * return true if attnum is out of range according to the tupdesc
> */
> if (attnum > tupleDesc->natts)
> return true;

Well, true actually tells us that the attribute is null, since that's
the purpose of the function:

/** slot_attisnull*        Detect whether an attribute of the slot is null, without*        actually fetching it.*/

I think the comment is more meaningfull before the change since it tells
us how nonexisting columns are interpreted.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: extensible external toast tuple support
Next
From: Amit Langote
Date:
Subject: Re: A minor correction in comment in heaptuple.c