mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
pageinspect: Add tests
This commit is contained in:
30
contrib/pageinspect/sql/page.sql
Normal file
30
contrib/pageinspect/sql/page.sql
Normal file
@ -0,0 +1,30 @@
|
||||
CREATE EXTENSION pageinspect;
|
||||
|
||||
CREATE TABLE test1 (a int, b text);
|
||||
INSERT INTO test1 VALUES (1, 'one');
|
||||
|
||||
VACUUM test1; -- set up FSM
|
||||
|
||||
-- The page contents can vary, so just test that it can be read
|
||||
-- successfully, but don't keep the output.
|
||||
|
||||
SELECT octet_length(get_raw_page('test1', 'main', 0)) AS main_0;
|
||||
SELECT octet_length(get_raw_page('test1', 'main', 1)) AS main_1;
|
||||
|
||||
SELECT octet_length(get_raw_page('test1', 'fsm', 0)) AS fsm_0;
|
||||
SELECT octet_length(get_raw_page('test1', 'fsm', 1)) AS fsm_1;
|
||||
|
||||
SELECT octet_length(get_raw_page('test1', 'vm', 0)) AS vm_0;
|
||||
SELECT octet_length(get_raw_page('test1', 'vm', 1)) AS vm_1;
|
||||
|
||||
SELECT octet_length(get_raw_page('xxx', 'main', 0));
|
||||
SELECT octet_length(get_raw_page('test1', 'xxx', 0));
|
||||
|
||||
SELECT get_raw_page('test1', 0) = get_raw_page('test1', 'main', 0);
|
||||
|
||||
SELECT tuple_data_split('test1'::regclass, t_data, t_infomask, t_infomask2, t_bits)
|
||||
FROM heap_page_items(get_raw_page('test1', 0));
|
||||
|
||||
SELECT * FROM fsm_page_contents(get_raw_page('test1', 'fsm', 0));
|
||||
|
||||
DROP TABLE test1;
|
Reference in New Issue
Block a user