{"id":43548,"library":"pg-doc","title":"pg-doc","description":"Produce markdown schema documentation for your Postgres database. Version 0.2.2 is current. Release cadence is low (last update Jan 2023). It generates a markdown file with table listings, columns, types, and descriptions. Supports configuration via CLI, JSON file, or environment variables. Differentiator: simple, single-purpose tool vs. heavier solutions like SchemaSpy or DBDoc.","status":"active","version":"0.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/echetzakis/pg-doc","tags":["javascript","postgres","markdown","database","documentation"],"install":[{"cmd":"npm install pg-doc","lang":"bash","label":"npm"},{"cmd":"yarn add pg-doc","lang":"bash","label":"yarn"},{"cmd":"pnpm add pg-doc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"PostgreSQL client for database connection","package":"pg","optional":false}],"imports":[{"note":"CLI tool, not a library. Use npx or global install.","wrong":"import pgDoc from 'pg-doc'","symbol":"pg-doc","correct":"npx pg-doc --db postgres://user:pass@localhost/mydb"}],"quickstart":{"code":"npm install -g pg-doc\npg-doc --db postgres://user:pass@localhost/mydb --out schema.md --title \"My Database\"","lang":"javascript","description":"Installs pg-doc globally and generates a markdown schema file for a Postgres database."},"warnings":[{"fix":"Ensure --db option is passed or connection key in config file.","message":"Connection string must be provided via --db flag or .pg-doc.json. No database URL leads to error.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Adjust --split-limit if you want splitting for smaller schemas.","message":"TOC split-limit default is 20. If fewer tables, no splitting occurs.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Use PGDOC_NO_DESCRIPTIONS (without extra L) if corrected in future versions, or use CLI flag instead.","message":"Environment variables use PGDOC prefix; note typo in PGDOC_NO_DESCRIPTIONSL variable name (extra 'L' at end).","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Use --no-descriptions to ignore database comments and rely on config file descriptions.","message":"Descriptions from database comments take precedence over config file descriptions if both exist.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.2.2':13 '2023':23 'cadenc':17 'cli':39 'column':32 'configur':37 'current':15 'databas':11,61 'dbdoc':57 'descript':35 'differenti':45 'doc':3 'document':7,62 'environ':43 'file':28,41 'generat':25 'heavier':52 'jan':22 'javascript':58 'json':40 'last':20 'like':54 'list':31 'low':19 'markdown':5,27,60 'pg':2 'pg-doc':1 'postgr':10,59 'produc':4 'purpos':49 'releas':16 'schema':6 'schemaspi':55 'simpl':46 'singl':48 'single-purpos':47 'solut':53 'support':36 'tabl':30 'tool':50 'type':33 'updat':21 'variabl':44 'version':12 'via':38 'vs':51","created_at":"2026-06-05T17:00:20.029691+00:00","updated_at":"2026-06-05T17:00:20.029691+00:00","problems":[{"fix":"Check host, port, and ensure postgres is running. Use 'localhost' or 127.0.0.1.","cause":"Postgres host not reachable or connection string malformed.","error":"Error: getaddrinfo ENOTFOUND localhost"},{"fix":"Run 'npm install pg' in the same directory, or install pg-doc globally with -g.","cause":"pg-doc depends on 'pg' but it's not installed.","error":"Error: Cannot find module 'pg'"},{"fix":"Add --db postgres://user:password@host:port/database or use .pg-doc.json with 'connection' key.","cause":"No database connection URL provided.","error":"pg-doc: Option 'connection' is required"},{"fix":"Use PostgreSQL 9.3+ which supports information_schema.tables.","cause":"Possibly using an old PostgreSQL version (pg-doc queries pg_catalog tables).","error":"Error: column \"table_name\" does not exist"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/echetzakis/pg-doc#readme","github":"https://github.com/echetzakis/pg-doc","docs":null,"changelog":null,"pypi":null,"npm":"pg-doc","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}