pgstattuple only allowed by superuser

235 views
Skip to first unread message

Zsolt Ero

unread,
Mar 20, 2019, 9:41:15 AM3/20/19
to Google Cloud SQL discuss
Hello,

I see that pgstattuple is a supported module, based in the official docs / changelog.

CREATE EXTENSION pgstattuple; runs with OK.

However, when I try to use module with 

SELECT * FROM pgstattuple('tablename');

It terminates with ERROR:  must be superuser to use pgstattuple functions.

I believe this is must be a bug, or otherwise why is this module advertised as supported?



George (Cloud Platform Support)

unread,
Apr 5, 2019, 11:16:46 AM4/5/19
to Google Cloud SQL discuss
Hello Zsolt, 

This behavior should not appear as unexpected: any features requiring superuser access are not supported. An exception to this rule is made for the CREATE EXTENSION statement, but only for supported extensions, as stated on the "Cloud SQL Features" page. pgstattuple does not fall under this category, as it does not appear on the list of supported extensions. You can check the status of that list on the "PostgreSQL Extensions" page

Ben Perlman

unread,
May 15, 2020, 2:34:14 PM5/15/20
to Google Cloud SQL discuss
It says that pgstattuple is supported here: https://cloud.google.com/sql/docs/postgres/release-notes#June_01_2017
Any ideas why its not actually on the supported extension page? 

mulem

unread,
May 21, 2020, 11:53:09 PM5/21/20
to Google Cloud SQL discuss
Hello Ben,

Pgstattuple was deprecated in November, 2018 due to compatibility and functionality issues which is why it no longer appears on the supported extensions page but is still listed in the release notes of June 2017 when it was first introduced.

Rodolphe QUIEDEVILLE

unread,
May 6, 2021, 9:42:14 AM5/6/21
to Google Cloud SQL discuss
Hi,
Thanks for this answer that help understanding the same issue I encountered.

If pgstattuple is not usable why letting it available ? 
What about removing from the available extensions list all that we can't use ?

postgres=> select * from pg_available_extensions where name ='pgstattuple';
    name     | default_version | installed_version |           comment           
-------------+-----------------+-------------------+-----------------------------
 pgstattuple | 1.5             | 1.5               | show tuple-level statistics
(1 row)

Best

Reply all
Reply to author
Forward
0 new messages