用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/G1Joshi/Agent-Skills --skill postgresql命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | postgresql |
| description | PostgreSQL relational database with JSONB, CTEs, window functions, and extensions. Use for SQL queries. |
PostgreSQL (Postgres) is a powerful, open-source object-relational database system. It is known for its reliability, feature robustness (JSONB, GIS, Full Text Search), and performance.
-- JSONB column usage
CREATE TABLE events (
id SERIAL PRIMARY KEY,
data JSONB
);
INSERT INTO events (data) VALUES ('{"type": "login", "user": "alice"}');
-- Query JSON directly (indexing supported)
SELECT * FROM events WHERE data->>'user' = 'alice';
Binary JSON storage. Faster to process and allows indexing.
CREATE INDEX idx_data ON events USING GIN (data);
Readable complex queries using WITH.
WITH regional_sales AS (
SELECT region, SUM(amount) AS total_sales
FROM orders
GROUP BY region
)
SELECT * FROM regional_sales WHERE total_sales > (SELECT SUM(total_sales)/10 FROM regional_sales);
Postgres handles simultaneous access by keeping multiple versions of a row. Readers don't block writers, and writers don't block readers.
Do:
pgvector: For AI/ML vector embeddings storage (Postgres 17+ optimizations).GENERATE_SERIES: Great for generating test data or filling gaps in time-series reports.work_mem: Default is low (4MB). Increase specific session work_mem for complex complex sort/hash operations.Don't:
NOT IN with NULLs: It often behaves counter-intuitively. Use NOT EXISTS.