create_pg_super_document is a project that generates documentation for all symbols in the PostgreSQL codebase, then utilizes these symbol documents to create high-quality documentation for functionalities, components, and other elements using AI agents
git clone https://github.com/ryogrid/create_pg_super_document.gitcreate_pg_super_document is a project that generates documentation for all symbols in the PostgreSQL codebase, then utilizes these symbol documents to create high-quality documentation for functionalities, components, and other elements using AI agents
[{"step":"Identify the symbol to document. This could be a function, type, view, or other PostgreSQL code element. Use your IDE or `grep` to locate its definition in the PostgreSQL source code.","tip":"Focus on symbols with poor or missing documentation. Use `git grep` with the symbol name to find all relevant files: `git grep -n 'pg_stat_progress_vacuum' src/`"},{"step":"Run the AI skill with the symbol name and PostgreSQL version. For example: `Analyze the PostgreSQL 16 codebase to generate documentation for pg_stat_progress_vacuum`.","tip":"If the symbol is complex, break it down into smaller parts. For example, document the main function first, then its helper functions separately."},{"step":"Review the generated documentation. The AI will provide a Markdown document with sections for definition, usage, examples, and pitfalls. Verify the accuracy of the examples and related symbols.","tip":"Cross-reference the AI-generated examples with the actual PostgreSQL source code or official documentation to ensure correctness."},{"step":"Integrate the documentation into your PostgreSQL knowledge base or internal wiki. Use the Markdown output directly or convert it to HTML/PDF for broader distribution.","tip":"For team collaboration, consider using tools like Docusaurus, MkDocs, or GitBook to host the generated documentation."},{"step":"Automate the process for frequently updated symbols. Set up a CI/CD pipeline to regenerate documentation whenever the PostgreSQL codebase changes.","tip":"Use GitHub Actions or GitLab CI to run the AI skill automatically on new commits to the PostgreSQL repository."}]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/ryogrid/create_pg_super_documentCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Generate a PostgreSQL Super Document for [SYMBOL_NAME] in the PostgreSQL codebase. Include: (1) a detailed symbol definition extracted from the code, (2) its purpose and usage context, (3) related symbols or dependencies, (4) examples of how it is used in real queries or functions, and (5) common pitfalls or performance considerations. Use the PostgreSQL 16 source code as reference. Format the output as a Markdown document with clear sections and code blocks for examples.
```markdown
# PostgreSQL Super Document: `pg_stat_progress_vacuum`
## Symbol Definition
**File:** `src/backend/commands/vacuum.c`
**Type:** System View
**Definition:** A system view that reports progress of VACUUM operations in PostgreSQL. It is populated during VACUUM execution and provides real-time metrics about the operation's progress.
## Purpose & Usage Context
`pg_stat_progress_vacuum` is used to monitor long-running VACUUM operations, which can block table access during execution. Database administrators use this view to:
- Identify stalled VACUUM operations
- Estimate time remaining for VACUUM jobs
- Diagnose performance issues during maintenance
The view is automatically updated during VACUUM execution and is visible to all users with read access to system catalogs.
## Related Symbols
- `VacuumStmt` (parser definition)
- `vacuum()` (main vacuum function)
- `pg_stat_progress_base` (base view for progress tracking)
- `pg_class` (for table OIDs referenced in the view)
## Usage Examples
### Basic Monitoring Query
```sql
SELECT pid, datname, relid::regclass AS table_name,
phase, heap_blks_total, heap_blks_scanned,
heap_blks_vacuumed, index_vacuum_count
FROM pg_stat_progress_vacuum
WHERE relid = 'public.orders'::regclass;
```
### Identifying Stalled Operations
```sql
SELECT pid, datname, relid::regclass AS table_name,
now() - query_start AS duration,
phase, heap_blks_total, heap_blks_scanned
FROM pg_stat_progress_vacuum
WHERE now() - query_start > interval '5 minutes'
ORDER BY duration DESC;
```
### Performance Considerations
- The view adds minimal overhead to VACUUM operations
- Frequent queries against this view during active VACUUM may slightly impact performance
- For large tables, consider querying this view every 30-60 seconds rather than continuously
## Common Pitfalls
1. **Misinterpreting phases**: The `phase` column has multiple states (e.g., 'scanning heap', 'vacuuming heap'). Ensure you understand what each phase represents.
2. **Assuming completion**: The view shows progress, not completion. A VACUUM may appear to be making progress but still take hours to complete.
3. **Blocking queries**: While the view itself doesn't block, long-running queries against it during VACUUM may compound performance issues.
## Performance Impact
- **CPU:** Negligible (view is read-only)
- **Memory:** Minimal (data is cached in shared memory)
- **I/O:** None (data is already in memory)
## See Also
- [PostgreSQL VACUUM Documentation](https://www.postgresql.org/docs/current/sql-vacuum.html)
- `pg_stat_progress_base` (for other progress tracking views)
- `pg_stat_activity` (for active VACUUM processes)
```Smart cloud calling for sales teams
AI-assisted web application security testing
AI sales agent for lead generation and follow-up
A proxy. An Envoy controller. An out-of-process SDK. Power.
IronCalc is a spreadsheet engine and ecosystem
Get more done every day with Microsoft Teams – powered by AI
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan