On 09/04/2025 17:23, Tom Lane wrote:
Heikki Linnakangas 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
On 09.04.25 16:23, Tom Lane wrote:
Heikki Linnakangas 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 co
On 09.04.25 14:26, Heikki Linnakangas wrote:
It's a matter of taste, but personally I find 'if (tuple != NULL)' more
clear than 'if (HeapTupleIsValid(tuple))'. The presence of a macro
suggests that there might be other kinds of invalid tuples than a NULL
pointer, which just adds mental load.
Michael Paquier 于2025年4月10日周四 10:53写道:
> On Wed, Apr 09, 2025 at 05:43:24PM +0300, Heikki Linnakangas wrote:
> > Agreed. I use both, depending on which mood I'm in.
>
> Same here, extended to OidIsValid(), HeapTupleIsValid(), XLogRecPtr,
> etc., and I tend to prefer such macros, except if consist
On Wed, Apr 09, 2025 at 05:43:24PM +0300, Heikki Linnakangas wrote:
> Agreed. I use both, depending on which mood I'm in.
Same here, extended to OidIsValid(), HeapTupleIsValid(), XLogRecPtr,
etc., and I tend to prefer such macros, except if consistency of the
surroundings matter most. FWIW, I thi
Heikki Linnakangas 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
On 09/04/2025 14:51, Tender Wang wrote:
Hi,
While working on another patch, I find that tablecmds.c now has three
ways to check the validity of catalog tuples.
i.
if (tuple != NULL)
ii.
if (!tuple)
iii.
if (HeapTupleIsValid(tuple)
In tablecmds.c, most checks use macro HeapTupleIsValid. For
c
Hi,
While working on another patch, I find that tablecmds.c now has three
ways to check the validity of catalog tuples.
i.
if (tuple != NULL)
ii.
if (!tuple)
iii.
if (HeapTupleIsValid(tuple)
In tablecmds.c, most checks use macro HeapTupleIsValid. For
code readability,
I changed the first and th