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 1sLi26-00G9FS-JW for pgsql-general@arkaria.postgresql.org; Mon, 24 Jun 2024 11:38:50 +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 1sLi24-008mrv-Rs for pgsql-general@arkaria.postgresql.org; Mon, 24 Jun 2024 11:38:49 +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 1sLi24-008mrl-HC for pgsql-general@lists.postgresql.org; Mon, 24 Jun 2024 11:38:48 +0000 Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sLi22-002sca-2q for pgsql-general@lists.postgresql.org; Mon, 24 Jun 2024 11:38:47 +0000 Received: by mail-vs1-xe2e.google.com with SMTP id ada2fe7eead31-48f350bcd89so738946137.2 for ; Mon, 24 Jun 2024 04:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719229125; x=1719833925; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2Ncit+SSE8utz9orkbmqpLmT/LNJr22vJ5+vTLtOq98=; b=hEHVQ3YZ+ZPIrh17s4SnUVE50NKCqCCkvS8A4jv3yFd8kgk7lNfMCuNW/JHgl1wVrQ oEpaJ28iZ81ErRUUSSk/9UQnD1PKs/W53qyWSJs3l8iukyFRKXOXFnYfVtG8eD9fBQY0 kLP07fnNhDIKShjQZS7IgftG1i/iPWlaBWhZ5U/kHlKaoQwT+f+Txlhq3FbupRQMQCpC 4bqEaN1kzGON7dApAkWe0l5XvxIAJ3ESSCHhLPmZNSeveUVly05217qIj65fHt6SB1wM WrhM5AErSl7RD9E1AX0eSmipp3EOmTURuUj+Kio/8zdiJ5YbJwxOZfv2jX51aH97N/Ga AMhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719229125; x=1719833925; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2Ncit+SSE8utz9orkbmqpLmT/LNJr22vJ5+vTLtOq98=; b=bMkZsjKQsU9phSCvAIvkWemlHt5I4whGq8MaE/NQghl7eu+OPM3GhQDzDUsQoIGXL9 8YEGE4ZBJEUNYBIlGMQXE/Lwrnh717YBOQaDnfoMMdirXZMDeGeKDHPGxDTWfmwVM75m AAKejCxUNwXJPC5aG1dRelYplDlu1Qgm9pO183W2x4Iq9pqZBEfBFQH4rO1ZRN43F248 7SlzXOLz31WHl+jgy5wmdhmPSHn7g1HPC1/AFJMkxlyOr9u2Xgqvf3Iulr2lq6Lld0oA DIo6RVOYxwTE9iTHoldUIMqf9oTMYPAdU3nbAXr0Q4onXx0/p4RqK5ZBjMjWiGdaDA// 6M+g== X-Gm-Message-State: AOJu0YxmU4xkBP6jWjn2OpeYtyZ5NECaIthy3YNZQeoXrjFdYlhPWnDC uq3MzHcuzinEEb6kqv1zFJpI08ypXMofYTgdeVcySlObjNTB9nhw+La4rJlaPssuY22CznK5xBw jWUPABu5YMaZGOldl1T+1gvbbjs4= X-Google-Smtp-Source: AGHT+IF5na/JCrFrRKlcPe8JKw9eHszoRalHy1AeBew2rD3at6Bk77bwaiC7x8aCD8f8uqhNHAFUJ0HVQSnN1C1cYzY= X-Received: by 2002:a05:6102:301:b0:48c:3db1:94dd with SMTP id ada2fe7eead31-48f52be77cbmr3755874137.30.1719229125208; Mon, 24 Jun 2024 04:38:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kashif Zeeshan Date: Mon, 24 Jun 2024 16:38:33 +0500 Message-ID: Subject: Re: Issue with pgstattuple on Sequences in PostgreSQL To: Ayush Vatsa Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000004bb1fd061ba139a2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004bb1fd061ba139a2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi I dont think Sequences are support, please refer to the following documentation. https://www.postgresql.org/docs/current/pgstattuple.html Regards Kashif Zeeshan On Mon, Jun 24, 2024 at 4:09=E2=80=AFPM 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/pgst= attuple.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=3D> CREATE SEQUENCE serial START 101; > CREATE SEQUENCE > postgres=3D> SELECT * FROM pgstattuple('serial'); > ERROR: only heap AM is supported > postgres=3D> > > It got stuck in this if condition - > https://github.com/postgres/postgres/blob/master/contrib/pgstattuple/pgst= attuple.c#L326-L329 > How can one use pgstattuple on sequences? > > Regards, > Ayush Vatsa > --0000000000004bb1fd061ba139a2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

I dont think Sequences are support, = please refer to the following documentation.


<= div>Regards
Kashif Zeeshan

On Mon, Jun 24, 2024 at 4:09=E2= =80=AFPM Ayush Vatsa <ayushv= atsa1810@gmail.com> wrote:

Hi PostgreSQL Community,

I was = recently exploring the pgstattuple code directory and found this piece of c= ode: htt= ps://github.com/postgres/postgres/blob/master/contrib/pgstattuple/pgstattup= le.c#L255-L259.=C2=A0

It indicates that pgstattuple supports rela= tions, toast tables, materialized views, and sequences.
However, when I = executed a query with a sequence, I encountered the following error:

= postgres=3D> CREATE SEQUENCE serial START 101;
CREATE SEQUENCE
pos= tgres=3D> SELECT * FROM pgstattuple('serial');
ERROR: =C2=A0o= nly heap AM is supported
postgres=3D>

It got stuck in this if c= ondition - https://github.c= om/postgres/postgres/blob/master/contrib/pgstattuple/pgstattuple.c#L326-L32= 9
How can one use pgstattuple on sequences?=C2=A0

Regards,
= Ayush Vatsa

--0000000000004bb1fd061ba139a2--