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 1vAkMu-005c1B-15 for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Oct 2025 07:31:47 +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 1vAkMr-00EnDy-J9 for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Oct 2025 07:31:44 +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 1vAkMr-00EnDq-1r for pgsql-hackers@lists.postgresql.org; Mon, 20 Oct 2025 07:31:44 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vAkMo-002kEf-1A for pgsql-hackers@postgresql.org; Mon, 20 Oct 2025 07:31:43 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id BB5ED1400098; Mon, 20 Oct 2025 03:31:41 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Mon, 20 Oct 2025 03:31:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm1; t=1760945501; x= 1761031901; bh=zCCtpJChCV1P7Suq6NnAy5vsYHaNTekOOjny59IItO4=; b=G ruT+wqCeAZBGHqi0qKZ4DKHiCfJ8eE6RBEufx4G3L1BwzNhvH5vBu7ZrKS9QCJXr dwOz46QxDAPWc/j+K433vwJZa0Egy43L8JPwXgZNjqwfogoL2/zUvr73/rguQ2Cj dFucV35HMx4FVb+CQhKxmqHVWte+N+kQMLR9jpV5DZERowYYtpjxHMtp3wJWw+zt /PnFJAk56LwuQ4JKFq6ysFBBe9Z6+kxAVwAnJo4JBSN4TYMqxWEOb8z5CZk/HtCb RvjlnDMV9FNj9Vg3/lD97CJZvF9s4X97VEu2UerI8ltEI1zg/EcdlgaDMSqOs8X7 c/Th0o1VC3+XT6VpTLGCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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 :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1760945501; x=1761031901; bh=z CCtpJChCV1P7Suq6NnAy5vsYHaNTekOOjny59IItO4=; b=yz2WFzNIXwNRz0xTR sz5l7QN+bDGUstk/AYOb74FByveEbJXfoI/flGy+h+rIuVrQuQUzJpYUA1Emn60s FJQ2lEg1kSvhiTSbuL4iYMlpdwLrM8p94bfKus2rwh3SFVqVY3lhgUeiL7ev6J7S sn7F2BVYqOraC0rNRQ5sFPyMsRkCYi7D2RVcOM2CMMNG0EVF4isgVZuMGVbU4GAJ rZU+zAunyYe2zrBJj70ZTwbAhXi7QENje1x4Ak4RFPn0HXUqVrXpByblVlO7T0du FlXXu2BYtzAqOQfFi2p4Vl6JL+AHUz94Io1KRExzw5SgiWv2A3gtgwUgKK4Ac1b8 6BnQA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddufeejvddvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehpvghtvghrsegvihhsvghnthhrrghuthdrohhrghdprhgtphht thhopehjihgrnhdruhhnihhvvghrshgrlhhithihsehgmhgrihhlrdgtohhmpdhrtghpth htoheprhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhg shhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepth hglhesshhsshdrphhghhdrphgrrdhush X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Oct 2025 03:31:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1760945498; bh=2/myaWf9i0jTYwYjnR49IaLckO9ofqXR6zqVTm8YVZo=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=dgZqYg38GT0RcPdigO5Fd2C5sxZ3PnX9SdyMIN58/UQlPUYbxLB1gjXk4D3c1YLuo VfP+UOe18uE82NorzOMeIprmR73s5xllYp+I96I4ZmaODdyQLlT49z4qFrNs3hsDEt 3UlsWTBYhqeoFqHCwcmK9eirj+oWRb73pyLysyY/RD3NPCGJ9V06llIA7PTWLT+ssF zWduLhgGxTcZ/Okr/i75Iwoz9yhruCyOZvbXpFCDXOjRJZ51TVByv48ytdTDaz+U9F RrtZPlM2i/jl6qi69y4IyibnyAhSMrsQJ24ECazw1cKJ6MKQ+hvaB97F2IVDHO6iky kgrFl6OCpLIhw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 82C586A; Mon, 20 Oct 2025 09:31:38 +0200 (CEST) Date: Mon, 20 Oct 2025 09:31:38 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: jian he Cc: Peter Eisentraut , Tom Lane , PostgreSQL-development , Kirill Reshke Subject: Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt Message-ID: <202510200724.udgwkvemgo7v@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Oct-20, jian he wrote: > On Fri, Oct 17, 2025 at 8:13 PM Álvaro Herrera wrote: > /* > * transformStatsStmt - parse analysis for CREATE STATISTICS > * > * To avoid race conditions, it's important that this function relies only on > * the passed-in rel (and not on stmt->relation) as the target relation. > */ > CreateStatsStmt * > transformStatsStmt(Relation rel, CreateStatsStmt *stmt, const char *queryString) > the (Relation rel) effectively comes from "stmt->relations", which > conflict with the above comments. Hmm? It does not. The whole point is that the relation name (RangeVar stmt->relations) has already been resolved to an OID and locked, which is what we pass as 'Relation rel'. Trying to resolve the name to an OID again opens us up for race conditions. This is alleviated if the relation has already been locked, so maybe we can relax this comment; but it's not outright contradictory AFAICS. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Oh, great altar of passive entertainment, bestow upon me thy discordant images at such speed as to render linear thought impossible" (Calvin a la TV)