Issue with pgstattuple on Sequences in PostgreSQL

From: Ayush Vatsa <ayushvatsa1810(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Issue with pgstattuple on Sequences in PostgreSQL
Date: 2024-06-24 11:09:28
Message-ID: CACX+KaMOd3HHteOJNX7fkWxO+R=uLJkfKqE2-QUK8fKmKfOwqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kashif Zeeshan 2024-06-24 11:38:33 Re: Issue with pgstattuple on Sequences in PostgreSQL
Previous Message arun chirappurath 2024-06-24 10:29:01 Execute permission to function