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 1sLhZz-00G6o1-7e for pgsql-general@arkaria.postgresql.org; Mon, 24 Jun 2024 11:09: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 1sLhZx-008bXn-KW for pgsql-general@arkaria.postgresql.org; Mon, 24 Jun 2024 11:09:45 +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 1sLhZx-008bXe-9v for pgsql-general@lists.postgresql.org; Mon, 24 Jun 2024 11:09:45 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sLhZu-002sQN-TX for pgsql-general@lists.postgresql.org; Mon, 24 Jun 2024 11:09:44 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ebed33cb65so46400151fa.2 for ; Mon, 24 Jun 2024 04:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719227381; x=1719832181; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=R8QR+cg60A+DjrVuPA/OmOkZnPyrszqEDzMmDwgKa1E=; b=QSqEzgUW2ipCrB6DDYrYjPkp7+jEgarqClGQv8Q78p4ToGWSOCwmO3MAy/RuCfgjH/ q7WLmmuBzDnMNq9YC3AbCbC8Nmvs5S0QQlDSXFYCYkJ35MOS72nvLldAl8J+eRzW0lkB H3dtfRRA3yaFp//NH6qS5k25BpwAhqP1AWRvAeklgAL6olnJVVLsRc8dYlxw1JRK5gVK au5bOWCPvmxrjRULngyrQl1d0uBY3z4KrpEKTOtA77qNF0Dd/YBlWTZtIeKosyu+5O95 KPDhdPkEGd1VEQdjvrrU1lmwTaP4VWjodHEEeRU5XCb+gueKqWPVGv9rZLekFhJvzQ9C 23tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719227381; x=1719832181; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=R8QR+cg60A+DjrVuPA/OmOkZnPyrszqEDzMmDwgKa1E=; b=c4SRzNvRUdI4FKTytSz/eKc9IxKPeBO9+jbejoXmrVw8WbDmuvM4JhWOrms/mBFZMw Zpdh2XodN0hoqYRtidaGkcZjQr3DaceqrN9/W3a1i6peG0hMrokU9CJcaenReixxJSNH aAl36L+R8qOzDxU13M005hG+98bIyjwQvzPKnBaHqfwuvgT7wjrWocoEVxnpSYMwLUAL mxPoKeYdVMU0r7vhPGohhclLdGRsRVfWY1Fdb5+G3abqx5OR5q3Q3MhFWX2UklwOeKZo lV3M7bMlTr0DFt6n5L1ZJsLHH+2AVHiJ4B+6HKriijEFWh7mKebI58OqFyVJCaYrRMbm jj1A== X-Gm-Message-State: AOJu0YwS7G86IO5EQvYHZTpv9BrjwhWFZLjMOTjSY6fNB0uoXtDIiL11 vwrYfWGdjzBQOu8+9I1y1J4p2J8j74KdGjJeo0VcPM9mGcCR+OeNwbm+q4iKbEWB/OenJT8GMIh h3oL6jg17MV9RtSlleB+1hPT9Ea272DMjjTQ= X-Google-Smtp-Source: AGHT+IGJNtJI5MlKxKwTUISwk/YnoCrwTQzTcGuTYqNOCKo+7c09xB0jtZv7MuhLcntE+rdiaX7XwjZAfjcEgvHb0vU= X-Received: by 2002:a2e:9886:0:b0:2ec:57b4:1c6a with SMTP id 38308e7fff4ca-2ec5936fa52mr35362111fa.42.1719227380758; Mon, 24 Jun 2024 04:09:40 -0700 (PDT) MIME-Version: 1.0 From: Ayush Vatsa Date: Mon, 24 Jun 2024 16:39:28 +0530 Message-ID: Subject: Issue with pgstattuple on Sequences in PostgreSQL To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000051818c061ba0d1e4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000051818c061ba0d1e4 Content-Type: text/plain; charset="UTF-8" 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=> 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 --00000000000051818c061ba0d1e4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi PostgreSQL Community,

I was recently exploring= the pgstattuple code directory and found this piece of code: https://github.com/postgres/postgres/bl= ob/master/contrib/pgstattuple/pgstattuple.c#L255-L259.=C2=A0

It i= ndicates that pgstattuple supports relations, toast tables, materialized vi= ews, and sequences.
However, when I executed a query with a sequence, I = encountered the following error:

postgres=3D> CREATE SEQUENCE seri= al START 101;
CREATE SEQUENCE
postgres=3D> SELECT * FROM pgstattup= le('serial');
ERROR: =C2=A0only heap AM is supported
postgres= =3D>

It got stuck in this if condition - https://github.com/postgres/postgres/blob/master/contrib/pgstattuple/p= gstattuple.c#L326-L329
How can one use pgstattuple on sequences?=C2= =A0

Regards,
Ayush Vatsa

--00000000000051818c061ba0d1e4--