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.
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, or contrib only when the topic is a PostgreSQL core/contrib module shipped in the postgres repository.
Search local documentation and code first.
- Use
rg for targeted searches in doc/src/sgml and 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.
Ask DeepWiki MCP for repository-grounded context.
- Use
mcp__deepwiki__ask_question with repoName: "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.
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.
Save the final answer as Markdown.
- Ensure the current project has a
markdown directory; 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.
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.
1---2name: pgfaq3description: 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 outside postgres/postgres, external tools, drivers, cloud services, forks, or third-party products.4metadata:5 source: https://skillmd.com/skills/digoal/pgfaq6---78# pgfaq910## Scope1112Use this skill only for questions about the PostgreSQL core open-source project in `postgres/postgres`.1314Refuse 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.1516## Required Workflow17181. Confirm the current working directory is a PostgreSQL source checkout.19 - Verify expected paths exist, especially `doc/src/sgml`.20 - Prefer `git remote -v`, `git rev-parse --show-toplevel`, and directory checks when needed.21 - 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.22232. Classify the question before researching.24 - Confirm it is within PostgreSQL core scope.25 - Identify likely documentation areas under `doc/src/sgml`.26 - Identify likely source areas, such as `src/backend`, `src/include`, `src/bin`, `src/test`, or `contrib` only when the topic is a PostgreSQL core/contrib module shipped in the postgres repository.27283. Search local documentation and code first.29 - Use `rg` for targeted searches in `doc/src/sgml` and relevant source directories.30 - Read the smallest necessary source and documentation excerpts.31 - Prefer primary PostgreSQL docs and code over memory.32 - Capture exact file paths and line numbers for claims that matter.33344. Ask DeepWiki MCP for repository-grounded context.35 - Use `mcp__deepwiki__ask_question` with `repoName: "postgres/postgres"`.36 - Ask focused questions tied to the user's topic, not broad general prompts.37 - Treat DeepWiki as guidance to cross-check against local code and docs, not as the sole source.38395. Synthesize the answer.40 - Write in Chinese unless the user asks for another language.41 - Make the answer practical and source-backed.42 - Include code/doc references as local paths with line numbers when available.43 - Distinguish confirmed facts from inference.44 - Avoid unsupported advice, folklore, and version claims not backed by the checked source tree or docs.45466. Validate and revise before saving.47 - Send the draft substance to DeepWiki MCP and ask it to check correctness against `postgres/postgres`.48 - Re-check any DeepWiki correction against local docs or source code.49 - Revise the answer when a correction is substantiated.50 - Repeat the DeepWiki validation and local verification loop until no material correctness issues remain or remaining uncertainty is explicitly documented.51527. Save the final answer as Markdown.53 - Ensure the current project has a `markdown` directory; create it if missing.54 - Save the final answer under `markdown/` with a concise, filesystem-safe filename derived from the question.55 - Include a short source section listing the key local docs/code files and DeepWiki checks used.56 - Tell the user the saved file path.5758## Answer Format5960Use this structure unless the user's requested format clearly conflicts:6162```markdown63# <question-title>6465## 结论6667<direct answer>6869## 原理与证据7071<explanation grounded in PostgreSQL docs/code>7273## 实践建议7475<commands, SQL examples, configuration notes, or diagnostic steps when relevant>7677## 边界与版本说明7879<scope, caveats, source-tree/version limitations, uncertainties>8081## 参考来源8283- `doc/src/sgml/...`84- `src/...`85- DeepWiki MCP: `postgres/postgres` correctness check86```8788## Research Discipline8990- Use local PostgreSQL docs and source as the authority.91- Do not answer from memory when code or docs can be checked.92- Do not browse the web unless the user explicitly asks and the answer still stays within PostgreSQL core scope.93- Do not cite DeepWiki as a replacement for local evidence.94- Do not modify PostgreSQL source files while answering.95- Keep changes limited to the generated Markdown file and creating `markdown/` if needed.