跳到正文
Skillpedia
数据库8.6k · #12370

pgfaq

它能做什么

这个技能利用 PostgreSQL 的官方文档和源代码,回答关于 PostgreSQL 数据库本身的问题。适合需要准确 PostgreSQL 答案的数据库管理员和开发者。

适用场景

  • ✓你对 PostgreSQL 的行为、配置或性能有疑问的时候。
  • ✓你需要了解某个 PostgreSQL 功能在源代码中如何运作的时候。
  • ✓你想获得以官方文档为依据的 PostgreSQL 答案的时候。

技能链接

https://github.com/digoal/blog/blob/master/skills/pgfaq/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/digoal/blog/blob/master/skills/pgfaq/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“PostgreSQL 如何决定使用索引扫描还是顺序扫描?请查看文档和源代码。”

每周 5 个新技能,1 分钟读完。

工作原理

它先确认自己位于 PostgreSQL 源代码目录中,然后搜索官方文档和相关源代码,最后根据找到的证据作答。

技术内容(原始 SKILL.md)

作者在 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
常见问题

它会回答 PostgreSQL 扩展的问题吗?

不会。它只涵盖 PostgreSQL 核心项目,并拒绝关于第三方扩展的请求。

它需要源代码检出吗?

需要。它必须在 PostgreSQL 源代码检出目录中运行。

它会凭记忆回答吗?

不会。技能要求优先参考 PostgreSQL 的官方文档和代码,而不是凭记忆。

详情

作者的原始描述

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

热度

GitHub 星标
8.6k
排名
#12370
许可证
GPL-2.0
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能