-- tests for decoding of combined flags -- HEAP_XMAX_SHR_LOCK = (HEAP_XMAX_EXCL_LOCK | HEAP_XMAX_KEYSHR_LOCK) SELECT * FROM heap_tuple_infomask_flags(x'0050'::int, 0); -- HEAP_XMIN_FROZEN = (HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID) SELECT * FROM heap_tuple_infomask_flags(x'0300'::int, 0); -- HEAP_MOVED = (HEAP_MOVED_IN | HEAP_MOVED_OFF) SELECT * FROM heap_tuple_infomask_flags(x'C000'::int, 0); SELECT * FROM heap_tuple_infomask_flags(x'C000'::int, 0);
-- test all flags of t_infomask and t_infomask2 SELECT unnest(raw_flags) FROM heap_tuple_infomask_flags(x'FFFF'::int, x'FFFF'::int) ORDERBY1; SELECT unnest(combined_flags) FROM heap_tuple_infomask_flags(x'FFFF'::int, x'FFFF'::int) ORDERBY1;
-- no flags at all SELECT * FROM heap_tuple_infomask_flags(0, 0); -- no combined flags SELECT * FROM heap_tuple_infomask_flags(x'0010'::int, 0);
DROPTABLE test1;
-- check that using any of these functions with a partitioned table or index -- would fail createtable test_partitioned (a int) partition by range (a); createindex test_partitioned_index on test_partitioned (a); select get_raw_page('test_partitioned', 0); -- error about partitioned table select get_raw_page('test_partitioned_index', 0); -- error about partitioned index
-- a regular table which is a member of a partition set should work though createtable test_part1 partition of test_partitioned forvaluesfrom ( 1 ) to (100); select get_raw_page('test_part1', 0); -- get farther and error about empty table droptable test_partitioned;
-- check null bitmap alignment for table whose number of attributes is multiple of 8 createtable test8 (f1 int, f2 int, f3 int, f4 int, f5 int, f6 int, f7 int, f8 int); insertinto test8(f1, f8) values (x'7f00007f'::int, 0); select t_bits, t_data from heap_page_items(get_raw_page('test8', 0)); select tuple_data_split('test8'::regclass, t_data, t_infomask, t_infomask2, t_bits) from heap_page_items(get_raw_page('test8', 0)); droptable test8;
-- check storage of generated columns -- stored createtable test9s (a intnotnull, b int generated always as (a * 2) stored); insertinto test9s values (131584); select raw_flags, t_bits, t_data from heap_page_items(get_raw_page('test9s', 0)), lateral heap_tuple_infomask_flags(t_infomask, t_infomask2); select tuple_data_split('test9s'::regclass, t_data, t_infomask, t_infomask2, t_bits) from heap_page_items(get_raw_page('test9s', 0)); droptable test9s;
-- virtual createtable test9v (a intnotnull, b int generated always as (a * 2) virtual); insertinto test9v values (131584); select raw_flags, t_bits, t_data from heap_page_items(get_raw_page('test9v', 0)), lateral heap_tuple_infomask_flags(t_infomask, t_infomask2); select tuple_data_split('test9v'::regclass, t_data, t_infomask, t_infomask2, t_bits) from heap_page_items(get_raw_page('test9v', 0)); droptable test9v;
-- Failure with incorrect page size -- Suppress the DETAIL message, to allow the tests to work across various -- page sizes.
\set VERBOSITY terse SELECT fsm_page_contents('aaa'::bytea); SELECT page_checksum('bbb'::bytea, 0); SELECT page_header('ccc'::bytea);
\set VERBOSITY default
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.