personamanagmentlayer avatar

Postgresql Expert

This is a comprehensive PostgreSQL reference that goes deep on production database work. You get solid coverage of advanced data types like JSONB and arrays, full-text search implementation with tsvector, and detailed indexing strategies including when to use GIN, GiST, or BRIN indexes. The window functions and query optimization sections are practical. It's built for developers who need to tune performance, design efficient schemas, or debug slow queries rather than just run basic CRUD operations. The code examples are production-oriented, showing things like concurrent index creation and identifying unused indexes. Requires PostgreSQL 15 or higher and gives Claude access to psql and related command-line tools.

skills.sh installs
425
GitHub stars
44
last updated
Aug 21, 2026

Install

$ npx -y skills add personamanagmentlayer/pcl --skill postgresql-expert --agent claude-code

Installs into .claude/skills of the current project.

Files

PostgreSQL Expert

You are an expert in PostgreSQL with deep knowledge of advanced queries, indexing, performance tuning, replication, and database administration. You design and manage production PostgreSQL databases that are performant, reliable, and scalable.

Best Practices

1. Use Proper Data Types

-- Use specific types
-- Bad: VARCHAR(255) for everything
-- Good: Use appropriate types
email VARCHAR(255)
age INTEGER
price NUMERIC(10,2)
is_active BOOLEAN
created_at TIMESTAMP WITH TIME ZONE

2. Add Constraints

CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    email VARCHAR(255) UNIQUE NOT NULL,
    age INTEGER CHECK (age >= 0 AND age <= 150),
    status VARCHAR(20) DEFAULT 'active' CHECK (status IN ('active', 'inactive', 'banned'))
);

3. Use Transactions

BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;

4. Index Appropriately

-- Index foreign keys
CREATE INDEX idx_orders_user_id ON orders(user_id);

-- Index columns used in WHERE, JOIN, ORDER BY
CREATE INDEX idx_users_created_at ON users(created_at);

Sponsors

Details

Repository
github.com/personamanagmentlayer/pcl
Categories
Backend & APIs, Debugging, Databases
First seen
Jun 3, 2026

More from personamanagmentlayer/pcl

All 99
1wispbit-ai avatarpostgresql-expert-best-practices-code-reviewwispbit-ai/skillsPostgreSQL database design, migration, and performance optimization best practices. This skill should be used when writing, reviewing, or refactoring database s390skills.sh installs
2patricio0312rev avatarauth-security-reviewerpatricio0312rev/skillsReviews authentication and authorization implementation for session management, CSRF, cookie security, and auth flow vulnerabilities with findings, severity ass352skills.sh installs
3memtensor avatarmemos-cloud-servermemtensor/memos-cloud-skillExternal long-term memory and knowledge base backed by the MemOS Cloud API. Capabilities — search prior memory, add conversation messages, delete or correct mem336skills.sh installs
4jezweb avatarcloudflare-mcp-serverjezweb/claude-skillsBuild MCP servers on Cloudflare Workers - the only platform with official remote MCP support. TypeScript-based with OAuth, Durable Objects, and WebSocket hibern328skills.sh installs
5secondsky avatarsupabase-postgres-best-practicessecondsky/claude-skillsPostgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or d319skills.sh installs
6decebals avatarapi-contract-reviewdecebals/claude-code-javaReview REST API contracts for HTTP semantics, versioning, backward compatibility, and response consistency. Use when user asks "review API", "check endpoints", 315skills.sh installs