summaryrefslogtreecommitdiff
path: root/contrib/pgstattuple/pgstattuple.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pgstattuple/pgstattuple.c')
-rw-r--r--contrib/pgstattuple/pgstattuple.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c
index 7e2a7262a35..1fff762753b 100644
--- a/contrib/pgstattuple/pgstattuple.c
+++ b/contrib/pgstattuple/pgstattuple.c
@@ -323,7 +323,11 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
pgstattuple_type stat = {0};
SnapshotData SnapshotDirty;
- if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
+ /*
+ * Sequences always use heap AM, but they don't show that in the catalogs.
+ */
+ if (rel->rd_rel->relkind != RELKIND_SEQUENCE &&
+ rel->rd_rel->relam != HEAP_TABLE_AM_OID)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("only heap AM is supported")));