Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u2qyL-006s4U-CV for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Apr 2025 12:25:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u2qyJ-00BBWd-Np for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Apr 2025 12:25:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u2qyI-00BBWQ-R2 for pgsql-hackers@lists.postgresql.org; Thu, 10 Apr 2025 12:25:31 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2qyH-0043Mg-02 for pgsql-hackers@lists.postgresql.org; Thu, 10 Apr 2025 12:25:30 +0000 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id CB8F32540209; Thu, 10 Apr 2025 08:25:27 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Thu, 10 Apr 2025 08:25:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1744287927; x=1744374327; bh=fIJlFwBmr/7cL4yw0SdtpL9IvKTexl9EviM7SzIzF7s=; b= K8Gjvg/9hty8OvbFuZG5X0buHa2ZVRgeSwfcm+tDp7+K4NhZRIomMlUKcHiQ4yXg ypXF58F2aq+DyVRvecmWcWhezXOSjYGKb1xzgQm6H7EqpWyNn9QABap2ndj/ejgp w8O4hCVpgKB4qLQ5VlzI3vWiCUSt4LAR9l0qBHBIDiy/zUdTbgtSsnqWU2UdKp92 0QHWq49j/5N/1aiHhotQYnAsX9k59CWwgdPzRtHRONXv9RCnxwWGePxfTzOo/PHR 4MTsuIAmFAjY/A2Ony1htfeoF2k1l1G+SH/63+zWy1b9UpzFSgD+bm8oYVu1R26X csk7s+Fc3NHbULF8nSc/1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1744287927; x=1744374327; bh=f IJlFwBmr/7cL4yw0SdtpL9IvKTexl9EviM7SzIzF7s=; b=vIe/rlPEOFZoFPAtP m5CQLc1e4J5vC+CAQq2DDQJHfrGVL3r7xgH68p2kvrHAggsfbR2fEJlgIL+PwPqj Xbz7YD2fI/bQ/ySbQ6lnFNyBIS/I9mAKWPXYJdpCVIjlKS+ggOkoe197zBtcf+0x SYGt4K0pshZl+Z1sY5OD9l7Tdiq+RYJA1vJvzUEPh1SLeyTt0YmTM82Bz0AzqNRp 27xleMhz0qtiX+9IJydwkWDfuUmm6s6+NkgcRAjQRYpaoHAKcvhz1OBeE3hgFJRs uVnyJzkBFvhe/YqtDWRmcAPpr0v+nGIzi267PhsGehc63pcEvSayHkOlX/ZyopWj Lug5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdekledtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddv jeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghish gvnhhtrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpeehiedvhfeuhfeugefgfeeh geejtdevuefhtefhueefvddugfdtueehgfefudfhffenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdr ohhrghdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh ephhhlihhnnhgrkhgrsehikhhirdhfihdprhgtphhtthhopehtnhgurhifrghnghesghhm rghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrd hpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 10 Apr 2025 08:25:26 -0400 (EDT) Message-ID: Date: Thu, 10 Apr 2025 14:25:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Consistently use macro HeapTupleIsValid to check the validity of tuples in tablecmds.c To: Heikki Linnakangas , Tender Wang , PostgreSQL Hackers References: <9f5acdab-6519-4a3f-a67b-0e70fbc156e6@iki.fi> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <9f5acdab-6519-4a3f-a67b-0e70fbc156e6@iki.fi> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. agreed > 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. I'd be in favor of that.