Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c
Date
Msg-id 182145.1744208580@sss.pgh.pa.us
Whole thread Raw
In response to Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c
Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c
List pgsql-hackers
Heikki Linnakangas <hlinnaka@iki.fi> 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Possible api miuse bms_next_member
Next
From: Peter Eisentraut
Date:
Subject: Build macOS shared modules as dylib rather than bundle