postgresql

Provides PostgreSQL guidance covering schema design, indexing, query optimization, migrations and Row-Level Security.

6|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill postgresql-repairyourtech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/RepairYourTech/cfsa-antigravity/tree/main/.agent/skill-library/stack/databases/postgresql
Command: npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill postgresql-repairyourtech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires postgres, pgtyped, kysely, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides expert guidance on designing, optimizing, and integrating PostgreSQL databases, ensuring data integrity, performance, and scalability for your applications.

Core Features & Use Cases

  • Schema Design: Learn best practices for normalization, denormalization, and data types.
  • Indexing Strategies: Understand B-tree, GIN, GiST, and BRIN indexes for optimal query performance.
  • Query Optimization: Master EXPLAIN ANALYZE, CTEs, and window functions for efficient data retrieval.
  • Migrations & RLS: Implement zero-downtime migrations and secure data access with Row-Level Security.
  • Use Case: Optimize a slow-running e-commerce backend by analyzing query plans, adding appropriate indexes, and refining the database schema for better performance.

Quick Start

Use the postgresql skill to create an index on the email column of the users table.

Frequently Asked Questions about postgresql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize slow PostgreSQL queries in my TypeScript application?

Optimize slow PostgreSQL queries by analyzing execution plans with EXPLAIN ANALYZE, adding appropriate B-tree or GIN indexes, and using CTEs for efficient data retrieval in your TypeScript application.

What's the best way to design a scalable PostgreSQL schema for an e-commerce backend?

Design a scalable PostgreSQL schema by applying normalization best practices, selecting appropriate data types, and implementing JSONB columns for flexible data alongside structured relational fields for e-commerce backends.

How do I execute zero-downtime migrations and configure row-level security in PostgreSQL?

Execute zero-downtime migrations by carefully planning schema alterations without locking tables, and configure row-level security in PostgreSQL to enforce strict data access policies per user role.

Can I use Kysely and postgres.js for PostgreSQL database integration with TypeScript?

Yes, you can use Kysely and postgres.js for PostgreSQL database integration, providing type-safe query building and direct connection management within your TypeScript application architecture.

When do I need GIN or BRIN indexes for PostgreSQL query performance?

Use GIN indexes for PostgreSQL query performance when dealing with JSONB operations or full-text search, and apply BRIN indexes for large tables with naturally ordered physical data blocks.

How does connection pooling improve PostgreSQL performance in scalable applications?

Connection pooling improves PostgreSQL performance by reusing active database connections, reducing connection overhead, and maintaining application responsiveness under heavy concurrent traffic loads.