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 1upTmT-005y7P-75 for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Aug 2025 15:34:18 +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 1upTmR-0072c1-B1 for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Aug 2025 15:34:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1upTmQ-0072bt-I9 for pgsql-hackers@lists.postgresql.org; Fri, 22 Aug 2025 15:34:15 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1upTmN-001IST-2w for pgsql-hackers@postgresql.org; Fri, 22 Aug 2025 15:34:14 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id D02751D00231; Fri, 22 Aug 2025 11:34:09 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Fri, 22 Aug 2025 11:34:09 -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=fm2; t=1755876849; x= 1755963249; bh=afI9ENjm5aTsjgiWtyffeb0xJqmDgxh1jTmiiY+t8uw=; b=i 2f+SqKE6Q97/qPyr05tlrSkrTdon34bI2cojxPlXEjlB9oJFn+eSqF+lQPZoAeNJ 0t1ob3P/gb6ENyZ21fB93zkzjqscuzMLbqmgJR0Ht6Ocm32M27N5sYthsojcXQrn E93ROFc05WESGnW1aqcDqmojwp0wKvjVU3vi1Z+DCFOf3/bg+yjtRx8Q+XZYaRFg exAJdejRvoEp86LA9UfiVM+PUirmZ61kjSl36hGAblAZezcFMTAHTOAUWunmbwQv zw4y7aBuJ/YcmAN+QrAHKOijrfZNXcFr5SL+maloqjXtki86yzDF4yJmhMx+fqEV NOYGzz8c7tLhpv0ZtdGgg== 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=fm3; t=1755876849; x=1755963249; bh=a fI9ENjm5aTsjgiWtyffeb0xJqmDgxh1jTmiiY+t8uw=; b=T9xcgS3Xb9uU9D1vs TsIm+VyMCF2OvdHs/oabG9oCXv6gdZiGv0bIjq8zkYrmVtCAIja0Cbg4h7EByREX HY7Vnqjs70MENvcfely58yzqxWqLx3n4/sukfupj/nPAdIGT7uMflw8W2iHAiIHQ Ku5wDZwaQgqsD/zyYPbBm8feai1MHbcUMt+JAekxK3DIqhDn9Ngllo3+WIM0Aym2 MxF6Pmb5RYdD1qtaR8s9EvXyiZnpIz9KWGMMKe1YQ15pNUrTBgTZaC1MVNFCbSKF hjbLczp4phcHActinxCqjkKya+iozbNKs8u6BteB7CKFHNiJjoL6+3/c3E/VubSZ xqYMQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduieegudefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehjihgrnhdruhhnihhvvghrshgrlhhithihsehgmhgrihhlrdgt ohhmpdhrtghpthhtoheprhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtohhmpdhrtg hpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 22 Aug 2025 11:34:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1755876846; bh=guZGXFF8aHp15U2EpI0Lz2ce2Nfmkc7j4MVuS5nQzPc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=0eWgWog/7xSwkfX7qQUuLbxPQajS0IVPRoUZzIgOI+R33yioU+o4zbt0XHxWuYaEk Ryz0sB0GITB2J4yr743FZWamy5/frnU3n0dAd1eOr6pN+nGT70U5aVLMwBFAroaVHA lu9mWvzrxHNfgccuCTcYppHiw+IC/8dWg50b2TQp41L1WR9PPA0XdU6QmpKun8En6c 9/COVQJ18EDux4NdlqfU1wmYzu+LJQBUwxU4WGZ2ks5Yxf9DGKpOA8haq7Vx1alcbr Q6pKr1745wjSoUIlZBMLaC9/t/ZRf8lwoUNSHLza5NYZm6DCCoOtGNj9472JtlWZJT Sy1pwtWq81L/A== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 15B886E; Fri, 22 Aug 2025 17:34:06 +0200 (CEST) Date: Fri, 22 Aug 2025 17:34:06 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Kirill Reshke Cc: jian he , PostgreSQL-development Subject: Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt Message-ID: <202508221534.z4xe7cg4dwsu@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-Aug-22, Kirill Reshke wrote: > I am sorry: I am not following. CREATE STATISTIC will work only for > single HEAP (or other AM) relations. So, for "simple regular tables" > as one can say (not tablefunc). Ah yeah, you're right, I think we should say "a single table", or maybe "a single table or materialized view" if the latter case is supported (I don't remember offhand if it is). The error message is mostly concerned with rejecting the case of multiple relations being given in the FROM clause, because we said at the time that we needed to make the grammar flexible enough to support that case, but make it clear that it wasn't implemented yet. (It's a pity that we haven't implemented that thus far ... I suppose it must be a difficult problem.) > DETAIL: This operation is not supported for query result. I would say "This operation is only supported for tables [and matviews]." We don't need to list all the things that aren't supported, I think. But your example here is wrong: > db=# CREATE STATISTICS alt_stat2 ON a, b FROM tftest(1); > ERROR: cannot define statistics for relation "alt_stat2" > DETAIL: This operation is not supported for query result. It's not alt_stat2 that's the problem (that's the extstats object being created), but tftest(1). I don't know if we need to specify that the problem is in the FROM clause here -- seems obvious enough to me -- but maybe someone opines differently? ERROR: cannot define statistics for relation "tftest" DETAIL: The FROM clause may only contain a single table. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Si quieres ser creativo, aprende el arte de perder el tiempo"