pagevis

Visualise database pages in ascii code

Overview

PackageVersionCategoryLicenseLanguage
pagevis0.1STATMITSQL
IDExtensionBinLibLoadCreateTrustRelocSchema
6860pagevisNoNoNoYesNoYes-
Relatedpageinspect pg_visibility amcheck pg_surgery pgstattuple pg_dirtyread toastinfo pg_profile

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY0.11817161514pagevis-
RPMPIGSTY0.11817161514pagevis_$v-
DEBPIGSTY0.11817161514postgresql-$v-pagevis-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
d13.x86_64
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
d13.aarch64
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
u22.x86_64
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
u22.aarch64
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
u24.x86_64
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
u24.aarch64
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1
PIGSTY 0.1

Build

You can build the RPM / DEB packages for pagevis using pig build:

pig build pkg pagevis         # build RPM / DEB packages

Install

You can install pagevis directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install pagevis;          # Install for current active PG version
pig ext install -y pagevis -v 18  # PG 18
pig ext install -y pagevis -v 17  # PG 17
pig ext install -y pagevis -v 16  # PG 16
pig ext install -y pagevis -v 15  # PG 15
pig ext install -y pagevis -v 14  # PG 14
dnf install -y pagevis_18       # PG 18
dnf install -y pagevis_17       # PG 17
dnf install -y pagevis_16       # PG 16
dnf install -y pagevis_15       # PG 15
dnf install -y pagevis_14       # PG 14
apt install -y postgresql-18-pagevis   # PG 18
apt install -y postgresql-17-pagevis   # PG 17
apt install -y postgresql-16-pagevis   # PG 16
apt install -y postgresql-15-pagevis   # PG 15
apt install -y postgresql-14-pagevis   # PG 14

Create Extension:

CREATE EXTENSION pagevis;

Usage

pagevis: ASCII visualization of PostgreSQL database pages

pagevis provides an ASCII-graphical representation of the contents of a PostgreSQL database page. It requires the pageinspect extension.

Function

-- show_page(relation, block_number, line_width)
SELECT show_page('my_table', 0, 64);

Output Characters

CharacterMeaning
PPage header
UUnused line pointer
NNormal line pointer
RRedirect line pointer
DDead line pointer
(space)Free space (the “hole”)
[n]Tuple number (overlaid on tuple header)
HTuple header
#Tuple data
-Tuple invisible to current transaction (dead)
.Inter-tuple padding

Example

SELECT show_page('pvtest', 0, 64);
                             show_page
------------------------------------------------------------------
 PPPPPPPPPPPPPPPPPPPPPPPP001N002N003N004N005N006N007N008N009N010N
 011N012N013N014N015N016N017N018N019N020N...

 [226]HHHHHHHHHHHHHHHHHHH####....[225]HHHHHHHHHHHHHHHHHHH####....
 [224]HHHHHHHHHHHHHHHHHHH####....[223]HHHHHHHHHHHHHHHHHHH####....

The page header (P) and line pointers (N) appear at the start, free space in the middle, and tuples grow from the end of the page backward. The page is full when no more space remains between line pointers and tuples.

Requires superuser access (uses pageinspect’s get_raw_page).


Last Modified 2026-03-12: add pg extension catalog (95749bf)