schedoc

schedoc

pg_schedoc : Cross documentation between Django and DBT projects

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4330
schedoc
pg_schedoc
0.0.1
UTIL
GPL-3.0
SQL
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
----d--
No
No
No
Yes
no
no
Relationships
Requires
ddl_historization
See Also
pg_readme_test_extension
pg_readme
gzip
bzip
zstd
http
pg_net
pg_curl

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PIGSTY
0.0.1
18
17
16
15
14
pg_schedocddl_historization
RPM
PIGSTY
0.0.1
18
17
16
15
14
pg_schedoc_$vddl_historization_$v
DEB
PIGSTY
0.0.1
18
17
16
15
14
postgresql-$v-pg-schedocpostgresql-$v-ddl-historization
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
el8.aarch64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
el9.x86_64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
el9.aarch64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
el10.x86_64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
el10.aarch64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
d12.x86_64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
d12.aarch64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
d13.x86_64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
d13.aarch64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
u22.x86_64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
u22.aarch64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
u24.x86_64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
u24.aarch64
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1
PIGSTY 0.0.1

Source

pig build pkg pg_schedoc;		# build rpm/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_schedoc;		# install via package name, for the active PG version
pig install schedoc;		# install by extension name, for the current active PG version

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

Create this extension with:

CREATE EXTENSION schedoc CASCADE; -- requires ddl_historization

Usage

schedoc: Schema documentation via COMMENT on PostgreSQL objects

Builds automatic documentation from COMMENT on PostgreSQL objects. Requires the ddl_historization extension.

Setup

CREATE EXTENSION schedoc CASCADE;
SELECT schedoc_start();

Adding Column Documentation

Set comments on columns in JSON format with predefined fields:

COMMENT ON COLUMN my_table.id IS '{"status": "private"}';
COMMENT ON COLUMN my_table.email IS '{"status": "public"}';
COMMENT ON COLUMN my_table.name IS '{"status": "internal"}';

Querying Documentation

Query the parsed column comments:

SELECT * FROM schedoc_column_comments;

Result:

 databasename | tablename | columnname | status
--------------+-----------+------------+---------
 mydb         | my_table  | id         | private
 mydb         | my_table  | email      | public
 mydb         | my_table  | name       | internal

Use Case

Cross-reference column metadata with other systems (e.g., Django db_comment, DBT docs) to define data contracts between developers and data analysts.

Last updated on