database-query-best-practices
Installation
SKILL.md
Database Query Best Practices - Prevent Connection Pool Exhaustion
CRITICAL SKILL - READ THIS BEFORE QUERYING RAILWAY DATABASE
The Problem
When querying Railway production database from local development environment, you may encounter:
psycopg2.OperationalError: sorry, too many clients already
This happens when:
- Multiple local dev servers are running (
npm run dev,npm run develop) - Each dev server holds database connections open
- Connection pool limit is reached (300 total connections)
- No new connections can be established