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 1sLkkZ-00GNMO-SP for pgsql-general@arkaria.postgresql.org; Mon, 24 Jun 2024 14:32:56 +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 1sLkkW-009kie-0j for pgsql-general@arkaria.postgresql.org; Mon, 24 Jun 2024 14:32:52 +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 1sLkkV-009kiW-2l for pgsql-general@lists.postgresql.org; Mon, 24 Jun 2024 14:32:51 +0000 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sLkkS-002tqX-89 for pgsql-general@lists.postgresql.org; Mon, 24 Jun 2024 14:32:50 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 9E0BA11401AF; Mon, 24 Jun 2024 10:32:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 24 Jun 2024 10:32:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; 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=1719239566; x=1719325966; bh=jvAzdWk7ZBkPxUnZDZvB09RlyT5A4X1hndyVyXNyQlk=; b= I3xAcOx+5eeElwZ+pnub1w6Q9HiziLOeMS/FYLl0oeBECclILDFv+GFQXsmCJxXk cu9kxHxE3mQEUpKpg1Iq+/3heqInUZV45wAZwdVseftfiY4x6tuAoM2o7d4NZEs6 YOAUkv1pejtQgW6ngkhYdtfGn9XaWXwpndK36RbZBuTOPCVXsA31WiDOrPjkDNhD 0NB91vklfj3gFIKKzOgQLGzHAJdpw7tZvdHn7Mz82HRQrALFUewKWUoNVYZBYOLf vRsTof3QbxVCvQ7Ht7D1bnukDkAtueGri6GPjCfN8moHenhoYBOvTJna20jbUI1P t/YR16cRwcvel7lutF6JRQ== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719239566; x= 1719325966; bh=jvAzdWk7ZBkPxUnZDZvB09RlyT5A4X1hndyVyXNyQlk=; b=q 5LOKGGctEGWrOsOshiaqdv7jgoyTuf3Ynf8g+/J8mYdxgsb8GLWTF+C9nnnWVfTF m6DVhgXZOCBtYU+QO8WwBWTiHzm/UXfUzEt8AtHgjl3VqQV0SRnLYmGCiHo76q1+ f/gPnSF6iEtRbdX+HvcV0Z1Ug5s+HyuGnDnRcI06LvO84zIL03D3oBTzSMfOEAE9 JftEDWp14nPSD3n3WyJ31a0e6Uy6y5szf+e8gaFxmSUD6Dt26z02KnvIjNvmEu3L 9jBKvumHwFNF8gDkYpV8UkiqJ6wyXByq4p2jeocpTWEgo5jnjVkHGXXmw4ejRxPK lPWfsdzxeCVf6V24Xw4qw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeeguddgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeekvdeutdehveetteehiedtfedugfduffdvgfffuefh ffejueeltddtfeeiffegudenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhpohhsth hgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Jun 2024 10:32:45 -0400 (EDT) Message-ID: Date: Mon, 24 Jun 2024 07:32:45 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Issue with pgstattuple on Sequences in PostgreSQL To: Ayush Vatsa , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/24/24 04:09, Ayush Vatsa wrote: > Hi PostgreSQL Community, > > I was recently exploring the pgstattuple code directory and found this > piece of code: > https://github.com/postgres/postgres/blob/master/contrib/pgstattuple/pgstattuple.c#L255-L259 . > > It indicates that pgstattuple supports relations, toast tables, > materialized views, and sequences. > However, when I executed a query with a sequence, I encountered the > following error: > > postgres=> CREATE SEQUENCE serial START 101; > CREATE SEQUENCE > postgres=> SELECT * FROM pgstattuple('serial'); > ERROR:  only heap AM is supported > postgres=> File a bug report here: https://www.postgresql.org/account/login/?next=/account/submitbug/ > > It got stuck in this if condition - > https://github.com/postgres/postgres/blob/master/contrib/pgstattuple/pgstattuple.c#L326-L329 > How can one use pgstattuple on sequences? > > Regards, > Ayush Vatsa > -- Adrian Klaver adrian.klaver@aklaver.com