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 1up7Cu-00GvI3-0x for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Aug 2025 15:28:05 +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 1up7Cs-00GzFw-4i for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Aug 2025 15:28:02 +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 1up7Cr-00GzFn-R2 for pgsql-hackers@lists.postgresql.org; Thu, 21 Aug 2025 15:28:02 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1up7Cp-0012UM-2F for pgsql-hackers@postgresql.org; Thu, 21 Aug 2025 15:28:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 57LFRxnf1440198; Thu, 21 Aug 2025 11:27:59 -0400 From: Tom Lane To: Kirill Reshke cc: jian he , PostgreSQL-development Subject: Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt In-reply-to: References: Comments: In-reply-to Kirill Reshke message dated "Thu, 21 Aug 2025 20:20:52 +0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1440196.1755790079.1@sss.pgh.pa.us> Date: Thu, 21 Aug 2025 11:27:59 -0400 Message-ID: <1440197.1755790079@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Kirill Reshke writes: > On Thu, 21 Aug 2025 at 17:00, jian he wrote: >> RangeVar *rel = (RangeVar *) linitial(stmt->relations); >> if (!IsA(rel, RangeVar)) > These two lines are weird. Looks like linitial(stmt->relations) > should be assigned to variable with type Node* first? We take that sort of shortcut in many places. If there's not any need for the code to deal with more than one node type, an extra variable that's used just for the IsA test seems like a lot of notational overhead. regards, tom lane