diff options
| author | Peter Eisentraut | 2020-06-29 22:29:35 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2020-06-29 22:56:43 +0000 |
| commit | ee0202d552791f14bc407ce299628ce8d50eebe3 (patch) | |
| tree | 5abce35cf66587e328e71169d9db1b2783924242 /contrib/pgstattuple/expected | |
| parent | ea57e531b9487e042131ca1151a3ef5d655f40ec (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/expected')
| -rw-r--r-- | contrib/pgstattuple/expected/pgstattuple.out | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/contrib/pgstattuple/expected/pgstattuple.out b/contrib/pgstattuple/expected/pgstattuple.out index 9920dbfd408..40f7825ddb4 100644 --- a/contrib/pgstattuple/expected/pgstattuple.out +++ b/contrib/pgstattuple/expected/pgstattuple.out @@ -159,7 +159,7 @@ ERROR: "test_partitioned" (partitioned table) is not supported select pgstattuple('test_partitioned_index'); ERROR: "test_partitioned_index" (partitioned index) is not supported select pgstattuple_approx('test_partitioned'); -ERROR: "test_partitioned" is not a table or materialized view +ERROR: "test_partitioned" is not a table, materialized view, or TOAST table select pg_relpages('test_partitioned'); ERROR: "test_partitioned" is not a table, index, materialized view, sequence, or TOAST table select pgstatindex('test_partitioned'); @@ -173,7 +173,7 @@ create view test_view as select 1; select pgstattuple('test_view'); ERROR: "test_view" (view) is not supported select pgstattuple_approx('test_view'); -ERROR: "test_view" is not a table or materialized view +ERROR: "test_view" is not a table, materialized view, or TOAST table select pg_relpages('test_view'); ERROR: "test_view" is not a table, index, materialized view, sequence, or TOAST table select pgstatindex('test_view'); @@ -189,7 +189,7 @@ create foreign table test_foreign_table () server dummy_server; select pgstattuple('test_foreign_table'); ERROR: "test_foreign_table" (foreign table) is not supported select pgstattuple_approx('test_foreign_table'); -ERROR: "test_foreign_table" is not a table or materialized view +ERROR: "test_foreign_table" is not a table, materialized view, or TOAST table select pg_relpages('test_foreign_table'); ERROR: "test_foreign_table" is not a table, index, materialized view, sequence, or TOAST table select pgstatindex('test_foreign_table'); @@ -218,6 +218,25 @@ select pg_relpages('test_partition'); 0 (1 row) +-- toast tables should work +select pgstattuple((select reltoastrelid from pg_class where relname = 'test')); + pgstattuple +--------------------- + (0,0,0,0,0,0,0,0,0) +(1 row) + +select pgstattuple_approx((select reltoastrelid from pg_class where relname = 'test')); + pgstattuple_approx +----------------------- + (0,0,0,0,0,0,0,0,0,0) +(1 row) + +select pg_relpages((select reltoastrelid from pg_class where relname = 'test')); + pg_relpages +------------- + 0 +(1 row) + -- not for the index calls though, of course select pgstatindex('test_partition'); ERROR: relation "test_partition" is not a btree index |
