public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Heikki Linnakangas <[email protected]>
Cc: Tender Wang <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c
Date: Wed, 09 Apr 2025 10:23:00 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAHewXNmz6huegXfMvBE=t-Ngyrh=sS=J2VB+hnhd+sadppdXww@mail.gmail.com>
	<[email protected]>

Heikki Linnakangas <[email protected]> writes:
> Inconsistency is not good either though. I'm not sure it's worth the 
> churn, but I could get on board a patch to actually replace all 
> HeapTupleIsValid(tuple) calls with plain "tuple != NULL" checks. Keep 
> HeapTupleIsValid() just for compatibility, with a comment to discourage 
> using it.

Would you then advocate for also removing macros such as OidIsValid()
and PointerIsValid()?  That gets into a *lot* of code churn, and
subsequent back-patching pain.  We had a discussion about that
just recently IIRC, and decided not to go there.

There's also the perennial issue of whether to write
"if (foo != NULL)" or just "if (foo)".  I'm not sure it's worth
trying to standardize that completely.

			regards, tom lane






view thread (4+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c
  In-Reply-To: <[email protected]>

* 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