Skip to content
pg_readme

pg_readme

pg_readme : Generate a Markdown README from PostgreSQL COMMENT objects

Overview

ID Extension Package Version Category License Language
4300
pg_readme
pg_readme
0.7.1
UTIL
PostgreSQL
SQL
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
----d-r
No
No
No
Yes
yes
no
Relationships
Requires
hstore
See Also
ddlx
pg_render
schedoc
pgdd
meta
pgpdf
pg_get_functiondef
pg_dbms_metadata
pg_catcheck
pg_query_rewrite
Siblings
pg_readme_test_extension

Catalog release is 0.7.1; PGDG remains the RPM maintainer at 0.7.0, so the PIGSTY 0.7.1 RPM must not be published; PIGSTY maintains the 0.7.1 DEB package.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
MIXED
0.7.1
18
17
16
15
14
pg_readme hstore
RPM
PGDG
0.7.0
18
17
16
15
14
pg_readme_$v -
DEB
PIGSTY
0.7.1
18
17
16
15
14
postgresql-$v-pg-readme -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
el8.aarch64
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
el9.x86_64
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
el9.aarch64
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
el10.x86_64
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
el10.aarch64
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
PGDG 0.7.0
d12.x86_64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
d12.aarch64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
d13.x86_64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
d13.aarch64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
u22.x86_64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
u22.aarch64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
u24.x86_64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
u24.aarch64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
u26.x86_64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
u26.aarch64
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
PIGSTY 0.7.1
Package Version OS ORG SIZE File URL
pg_readme_18 0.7.0 el8.x86_64 pgdg 31.5 KiB pg_readme_18-0.7.0-1PGDG.rhel8.noarch.rpm
pg_readme_18 0.7.0 el8.aarch64 pgdg 31.5 KiB pg_readme_18-0.7.0-1PGDG.rhel8.noarch.rpm
pg_readme_18 0.7.0 el9.x86_64 pgdg 30.8 KiB pg_readme_18-0.7.0-1PGDG.rhel9.8.noarch.rpm
pg_readme_18 0.7.0 el9.x86_64 pgdg 30.8 KiB pg_readme_18-0.7.0-1PGDG.rhel9.noarch.rpm
pg_readme_18 0.7.0 el9.aarch64 pgdg 30.7 KiB pg_readme_18-0.7.0-1PGDG.rhel9.8.noarch.rpm
pg_readme_18 0.7.0 el9.aarch64 pgdg 30.7 KiB pg_readme_18-0.7.0-1PGDG.rhel9.noarch.rpm
pg_readme_18 0.7.0 el10.x86_64 pgdg 31.0 KiB pg_readme_18-0.7.0-1PGDG.rhel10.2.noarch.rpm
pg_readme_18 0.7.0 el10.x86_64 pgdg 31.4 KiB pg_readme_18-0.7.0-1PGDG.rhel10.noarch.rpm
pg_readme_18 0.7.0 el10.aarch64 pgdg 31.0 KiB pg_readme_18-0.7.0-1PGDG.rhel10.2.noarch.rpm
pg_readme_18 0.7.0 el10.aarch64 pgdg 31.3 KiB pg_readme_18-0.7.0-1PGDG.rhel10.noarch.rpm
postgresql-18-pg-readme 0.7.1 d12.x86_64 pigsty 19.5 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~bookworm_all.deb
postgresql-18-pg-readme 0.7.1 d12.aarch64 pigsty 19.5 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~bookworm_all.deb
postgresql-18-pg-readme 0.7.1 d13.x86_64 pigsty 19.5 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~trixie_all.deb
postgresql-18-pg-readme 0.7.1 d13.aarch64 pigsty 19.5 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~trixie_all.deb
postgresql-18-pg-readme 0.7.1 u22.x86_64 pigsty 20.0 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~jammy_all.deb
postgresql-18-pg-readme 0.7.1 u22.aarch64 pigsty 20.0 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~jammy_all.deb
postgresql-18-pg-readme 0.7.1 u24.x86_64 pigsty 20.0 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~noble_all.deb
postgresql-18-pg-readme 0.7.1 u24.aarch64 pigsty 20.0 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~noble_all.deb
postgresql-18-pg-readme 0.7.1 u26.x86_64 pigsty 20.1 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~resolute_all.deb
postgresql-18-pg-readme 0.7.1 u26.aarch64 pigsty 20.1 KiB postgresql-18-pg-readme_0.7.1-1PIGSTY~resolute_all.deb

Source

pig build pkg pg_readme;		# build deb

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install pg_readme;		# install via package name, for the active PG version

pig install pg_readme -v 18;   # install for PG 18
pig install pg_readme -v 17;   # install for PG 17
pig install pg_readme -v 16;   # install for PG 16
pig install pg_readme -v 15;   # install for PG 15
pig install pg_readme -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION pg_readme CASCADE; -- requires hstore

Usage

Sources:

pg_readme generates Markdown documentation for a PostgreSQL extension or schema from COMMENT objects and live catalog metadata. Use it to keep an extension’s README close to its SQL definitions and verify the generated output in source control.

Install and Generate Markdown

CREATE EXTENSION pg_readme CASCADE;

SELECT pg_extension_readme('my_extension'::name);
SELECT pg_schema_readme('my_schema'::regnamespace);

The control file requires hstore, is relocatable, and permits non-superuser installation when the caller can install its dependencies and create the objects.

Add Processing Instructions

Put Markdown and processing instructions in the extension or schema comment:

COMMENT ON EXTENSION my_extension IS $markdown$
### `my_extension`

What the extension does.

### Reference

<?pg-readme-reference?>

### Colophon

<?pg-readme-colophon?>
$markdown$;

<?pg-readme-reference?> expands to a catalog-derived object reference. <?pg-readme-colophon?> adds generation metadata. Optional instruction attributes can adjust the heading depth when embedding generated sections.

Settings

  • pg_readme.include_view_definitions: include view definitions; default true.
  • pg_readme.include_routine_definitions_like: array of routine-name patterns whose definitions are included; default '{test__%}'.
  • pg_readme.include_this_routine_definition: routine-local override for including the current definition.
  • pg_readme.readme_url: upstream README link used by generated material.

Use SET options on a wrapper function or transaction when a project needs reproducible generation settings.

Version 0.7.1 and Caveats

  • Version 0.7.1 fixes PostgreSQL 18 reference generation that could duplicate array/composite table types and NOT NULL markers.
  • Upstream and the current Pigsty DEB package are 0.7.1, while the current Pigsty RPM package remains 0.7.0. Check pg_available_extension_versions before relying on the PostgreSQL 18 fix.
  • Generated output reflects the current database catalog, installed extension versions, comments, and generation time. Review diffs instead of assuming two environments produce identical text.
  • Catalog introspection does not replace hand-written operational guidance. Keep prerequisites, preload/restart behavior, upgrade notes, and unsafe operations in curated prose.
  • The singular setting pg_readme.include_routine_definition_like appears in an old README wrapper example, but the documented current GUC is the plural pg_readme.include_routine_definitions_like.
Last updated on