diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2020-06-30 00:29:35 +0200 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2020-06-30 00:56:43 +0200 |
| commit | ee0202d552791f14bc407ce299628ce8d50eebe3 (patch) | |
| tree | 5abce35cf66587e328e71169d9db1b2783924242 /contrib/pg_visibility/sql | |
| 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/pg_visibility/sql')
| -rw-r--r-- | contrib/pg_visibility/sql/pg_visibility.sql | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/pg_visibility/sql/pg_visibility.sql b/contrib/pg_visibility/sql/pg_visibility.sql index c78b90521bf..f79b54480b7 100644 --- a/contrib/pg_visibility/sql/pg_visibility.sql +++ b/contrib/pg_visibility/sql/pg_visibility.sql @@ -68,12 +68,15 @@ select pg_check_frozen('test_foreign_table'); select pg_truncate_visibility_map('test_foreign_table'); -- check some of the allowed relkinds -create table regular_table (a int); -insert into regular_table values (1), (2); +create table regular_table (a int, b text); +alter table regular_table alter column b set storage external; +insert into regular_table values (1, repeat('one', 1000)), (2, repeat('two', 1000)); vacuum regular_table; select count(*) > 0 from pg_visibility('regular_table'); +select count(*) > 0 from pg_visibility((select reltoastrelid from pg_class where relname = 'regular_table')); truncate regular_table; select count(*) > 0 from pg_visibility('regular_table'); +select count(*) > 0 from pg_visibility((select reltoastrelid from pg_class where relname = 'regular_table')); create materialized view matview_visibility_test as select * from regular_table; vacuum matview_visibility_test; |
