(unnamed)
text/plain
\echo This script is designed to run in a database called 'test'
\echo and requires installation of /contrib/pageinspect and
\echo /contrib/pg_freespacemap.
\c test
DROP TABLE IF EXISTS mvcc_demo;
CREATE TABLE mvcc_demo (val INTEGER);
DROP VIEW IF EXISTS mvcc_demo_page0;
CREATE VIEW mvcc_demo_page0 AS
SELECT '(0,' || lp || ')' AS ctid,
CASE lp_flags
WHEN 0 THEN 'Unused'
WHEN 1 THEN 'Normal'
WHEN 2 THEN 'Redirect to ' || lp_off
WHEN 3 THEN 'Dead'
END,
t_xmin::text::int8 AS xmin,
t_xmax::text::int8 AS xmax,
t_ctid
FROM heap_page_items(get_raw_page('mvcc_demo', 0))
ORDER BY lp;