summaryrefslogtreecommitdiff
path: root/contrib/pgstattuple/sql
diff options
context:
space:
mode:
authorPeter Eisentraut2020-06-29 22:29:35 +0000
committerPeter Eisentraut2020-06-29 22:56:43 +0000
commitee0202d552791f14bc407ce299628ce8d50eebe3 (patch)
tree5abce35cf66587e328e71169d9db1b2783924242 /contrib/pgstattuple/sql
parentea57e531b9487e042131ca1151a3ef5d655f40ec (diff)
pgstattuple: Have pgstattuple_approx accept TOAST tables
TOAST tables have a visibility map and a free space map, so they can be supported by pgstattuple_approx just fine. Add test cases to show how various pgstattuple functions accept TOAST tables. Also add similar tests to pg_visibility, which already accepted TOAST tables correctly but had no test coverage for them. Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at> Discussion: https://www.postgresql.org/message-id/flat/27c4496a-02b9-dc87-8f6f-bddbef54e0fe@2ndquadrant.com
Diffstat (limited to 'contrib/pgstattuple/sql')
-rw-r--r--contrib/pgstattuple/sql/pgstattuple.sql5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/pgstattuple/sql/pgstattuple.sql b/contrib/pgstattuple/sql/pgstattuple.sql
index cfa540302da..5111be0e625 100644
--- a/contrib/pgstattuple/sql/pgstattuple.sql
+++ b/contrib/pgstattuple/sql/pgstattuple.sql
@@ -100,6 +100,11 @@ select pgstattuple('test_partition');
select pgstattuple_approx('test_partition');
select pg_relpages('test_partition');
+-- toast tables should work
+select pgstattuple((select reltoastrelid from pg_class where relname = 'test'));
+select pgstattuple_approx((select reltoastrelid from pg_class where relname = 'test'));
+select pg_relpages((select reltoastrelid from pg_class where relname = 'test'));
+
-- not for the index calls though, of course
select pgstatindex('test_partition');
select pgstatginindex('test_partition');