pgfaq
What it does
This skill answers questions about the PostgreSQL database itself using its official documentation and source code. It is for database administrators and developers who need accurate PostgreSQL answers.
When to use it
- ✓When you have a question about PostgreSQL behavior, configuration or performance.
- ✓When you need to know how a PostgreSQL feature works inside the source code.
- ✓When you want a PostgreSQL answer backed by the official docs.
Skill link
https://github.com/digoal/blog/blob/master/skills/pgfaq/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“How does PostgreSQL decide whether to use an index scan or a sequential scan? Check the docs and source.”
5 new skills a week. 1 minute to read.
How it works
It checks that it is in a PostgreSQL source folder, searches the official docs and related source code, then answers with the evidence it found.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
pgfaq
Scope
Use this skill only for questions about the PostgreSQL core open-source project in postgres/postgres.
Refuse the request if it is about a project outside PostgreSQL core, including third-party extensions, plugins, tools, drivers, cloud products, forks, wrappers, or ecosystem projects. State briefly that pgfaq only answers PostgreSQL core questions.
Required Workflow
Confirm the current working directory is a PostgreSQL source checkout.
- Verify expected paths exist, especially
doc/src/sgml. - Prefer
git remote -v,git rev-parse --show-toplevel, and directory checks when needed. - If the current directory is not a PostgreSQL source tree, stop and ask the user to run from a postgres source checkout or provide the correct path.
- Verify expected paths exist, especially
Classify the question before researching.
- Confirm it is within PostgreSQL core scope.
- Identify likely documentation areas under
doc/src/sgml. - Identify likely source areas, such as
src/backend,src/include,src/bin,src/test, orcontribonly when the topic is a PostgreSQL core/contrib module shipped in the postgres repository.
Search local documentation and code first.
- Use
rgfor targeted searches indoc/src/sgmland relevant source directories. - Read the smallest necessary source and documentation excerpts.
- Prefer primary PostgreSQL docs and code over memory.
- Capture exact file paths and line numbers for claims that matter.
- Use
Ask DeepWiki MCP for repository-grounded context.
- Use
mcp__deepwiki__ask_questionwithrepoName: "postgres/postgres". - Ask focused questions tied to the user's topic, not broad general prompts.
- Treat DeepWiki as guidance to cross-check against local code and docs, not as the sole source.
- Use
Synthesize the answer.
- Write in Chinese unless the user asks for another language.
- Make the answer practical and source-backed.
- Include code/doc references as local paths with line numbers when available.
- Distinguish confirmed facts from inference.
- Avoid unsupported advice, folklore, and version claims not backed by the checked source tree or docs.
Validate and revise before saving.
- Send the draft substance to DeepWiki MCP and ask it to check correctness against
postgres/postgres. - Re-check any DeepWiki correction against local docs or source code.
- Revise the answer when a correction is substantiated.
- Repeat the DeepWiki validation and local verification loop until no material correctness issues remain or remaining uncertainty is explicitly documented.
- Send the draft substance to DeepWiki MCP and ask it to check correctness against
Save the final answer as Markdown.
- Ensure the current project has a
markdowndirectory; create it if missing. - Save the final answer under
markdown/with a concise, filesystem-safe filename derived from the question. - Include a short source section listing the key local docs/code files and DeepWiki checks used.
- Tell the user the saved file path.
- Ensure the current project has a
Answer Format
Use this structure unless the user's requested format clearly conflicts:
# <question-title>
## 结论
<direct answer>
## 原理与证据
<explanation grounded in PostgreSQL docs/code>
## 实践建议
<commands, SQL examples, configuration notes, or diagnostic steps when relevant>
## 边界与版本说明
<scope, caveats, source-tree/version limitations, uncertainties>
## 参考来源
- `doc/src/sgml/...`
- `src/...`
- DeepWiki MCP: `postgres/postgres` correctness check
Research Discipline
- Use local PostgreSQL docs and source as the authority.
- Do not answer from memory when code or docs can be checked.
- Do not browse the web unless the user explicitly asks and the answer still stays within PostgreSQL core scope.
- Do not cite DeepWiki as a replacement for local evidence.
- Do not modify PostgreSQL source files while answering.
- Keep changes limited to the generated Markdown file and creating
markdown/if needed.
FAQ
Does it answer questions about PostgreSQL extensions?
No, it only covers the PostgreSQL core project and refuses requests about third-party extensions.
Does it need a source checkout?
Yes, it needs to run from a PostgreSQL source checkout.
Does it answer from memory?
No, the skill says to prefer primary PostgreSQL docs and code over memory.
Details
Original description by the author
Answer PostgreSQL core database questions by researching the local postgres source tree, PostgreSQL documentation under doc/src/sgml, relevant source code, and DeepWiki repository knowledge for postgres/postgres; use when the user asks any PostgreSQL database behavior, internals, SQL, configuration, administration, performance, storage, planner, executor, replication, or documentation question and wants a sourced Markdown answer saved to the current project's markdown directory. Refuse questions about non-PostgreSQL-core projects, including PostgreSQL ecosystem plugins, extensions maintained o
repo: digoal/blog
Popularity
- GitHub stars
- 8.6k
- Ranking position
- #12370
- License
- GPL-2.0
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
article-to-podcast-script
8.6kHelps your agent turn a Markdown article into a first-person podcast script for one to four speakers, saved as a text file, in Chinese by default.
axiom-explainer
8.6kHelps your agent write a clear Chinese article that explains one viewpoint, law or theory, with examples, limits and simple diagrams for readers.
blog-cover-poster
8.6kHelps your agent turn an article or notes into a set of vertical poster images, with a cover and several slides that explain the main points.
buffett
8.6kHelps your agent think through company and stock decisions the way Warren Buffett does, using his ideas on moats, management and margin of safety.
Similar skills
discrawl
394kLets your agent search and summarize a saved local archive of Discord messages, check how fresh it is, and read direct messages.
clickhouse-io
280kHelps your agent optimize queries and schemas in ClickHouse databases. It applies best practices for high-performance analytical workloads. Use when analytical queries are too slow.
scientific-db-pubmed-database
280kHelps your agent search for scientific articles in the biomedical field. It's useful for research needing specific medical information.