pg_readme

Generate a README.md document for a database extension or schema

Overview

PackageVersionCategoryLicenseLanguage
pg_readme0.7.0UTILPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
4300pg_readmeNoNoNoYesYesYes-
4301pg_readme_test_extensionNoNoNoYesYesYes-
Relatedhstore ddl_historization schedoc pg_render gzip bzip zstd http pg_net

Version

TypeRepoVersionPG VerPackageDeps
EXTMIXED0.7.01817161514pg_readmehstore
RPMPGDG0.7.01817161514pg_readme_$v-
DEBPIGSTY0.7.01817161514postgresql-$v-pg-readme-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
d13.aarch64
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
u22.x86_64
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
u22.aarch64
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
u24.x86_64
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
u24.aarch64
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0
PIGSTY 0.7.0

Build

You can build the DEB packages for pg_readme using pig build:

pig build pkg pg_readme         # build DEB packages

Install

You can install pg_readme 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 pg_readme;          # Install for current active PG version
pig ext install -y pg_readme -v 18  # PG 18
pig ext install -y pg_readme -v 17  # PG 17
pig ext install -y pg_readme -v 16  # PG 16
pig ext install -y pg_readme -v 15  # PG 15
pig ext install -y pg_readme -v 14  # PG 14
dnf install -y pg_readme_18       # PG 18
dnf install -y pg_readme_17       # PG 17
dnf install -y pg_readme_16       # PG 16
dnf install -y pg_readme_15       # PG 15
dnf install -y pg_readme_14       # PG 14
apt install -y postgresql-18-pg-readme   # PG 18
apt install -y postgresql-17-pg-readme   # PG 17
apt install -y postgresql-16-pg-readme   # PG 16
apt install -y postgresql-15-pg-readme   # PG 15
apt install -y postgresql-14-pg-readme   # PG 14

Create Extension:

CREATE EXTENSION pg_readme CASCADE;  -- requires: hstore

Usage

pg_readme: Auto-generate README documentation from PostgreSQL COMMENT objects

Generates README.md documents for extensions or schemas based on COMMENT objects in the pg_description system catalog.

Generate Extension README

SELECT pg_extension_readme('my_extension'::name);

Generate Schema README

SELECT pg_schema_readme('my_schema'::regnamespace);

Processing Instructions

Include these XML processing instructions in your COMMENT ON EXTENSION or COMMENT ON SCHEMA:

  • <?pg-readme-reference?> – replaced with a full object reference
  • <?pg-readme-colophon?> – adds a colophon with pg_readme info

Typical Workflow

Create a readme-generating function in your extension:

CREATE FUNCTION my_ext_readme() RETURNS text
    VOLATILE SET search_path FROM current
    SET pg_readme.include_view_definitions TO 'true'
    LANGUAGE plpgsql AS $$
DECLARE _readme text;
BEGIN
    CREATE EXTENSION IF NOT EXISTS pg_readme WITH VERSION '0.1.0';
    _readme := pg_extension_readme('my_extension'::name);
    RAISE transaction_rollback;
EXCEPTION WHEN transaction_rollback THEN RETURN _readme;
END; $$;

Then generate with: make README.md

Settings

SettingDefault
pg_readme.include_view_definitionstrue
pg_readme.include_routine_definitions_like'{test__%}'
pg_readme.include_this_routine_definitionnull

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