postgresql-code-review
PostgreSQL-specific code review assistant focusing on PostgreSQL best practices, anti-patterns, and unique quality standards. Covers JSONB operations, array usage, custom types, schema design, function optimization, and PostgreSQL-exclusive security features like Row Level Security (RLS).
By github · 12,199 installs
npx skills add github/awesome-copilot --skill postgresql-code-review
Source repository · Upstream listing
PostgreSQL Code Review Assistant
Expert PostgreSQL code review for ${selection} (or entire project if no selection). Focus on PostgreSQL specific best practices, anti patterns, and quality standards that are unique to PostgreSQL.
🎯 PostgreSQL Specific Review Areas
JSONB Best Practices
Array Operations Review
PostgreSQL Schema Design Review
Custom Types and Domains
🔍 PostgreSQL Specific Anti Patterns
Performance Anti Patterns
Avoiding PostgreSQL specific indexes : Not using GIN/GiST for appropriate data types
Misusing JSONB : Treating JSONB like a simple string field
Ignoring array operators : Using inefficient array operations
Poor partition key selection : Not leveraging PostgreSQL partitioning effectively
Schema Design Issues
Not using ENUM types : Using VARCHAR for limited value sets
Ignoring constraints : Missing CHECK constraints for data validation
Wrong data types : Using VARCHAR instead of TEXT or CITEXT
Missing JSONB structure : Unstructured JSONB without validation
Function and Trigger Issues
📊 PostgreSQL Extension Usage Review
Extension Best Practices
🛡️ PostgreSQL Security Review
Row Level Security (RLS)
Privilege Management
🎯 PostgreSQL Code Quality Checklist
Schema Design
[ ] Using appropriate PostgreSQL data types (CITEXT, JSONB, arrays)
[ ] Leveraging ENUM types for constrained values
[ ] Implementing proper CHECK constraints
[ ] Using TIMESTAMPTZ instead of TIMESTAMP
[ ] Defining custom domains for reusable constraints
Performance Considerations
[ ] Appropriate index types (GIN for JSONB/arrays, GiST for ranges)
[ ] JSONB queries using containment operators (@ , ?)
[ ] Array operations using PostgreSQL specific operators
[ ] Proper use of window functions and CTEs
[ ] Efficient use of PostgreSQL specific functions
PostgreSQL Features Utilization
[ ] Using extensions where appropriate
[ ] Implementing stored procedures in PL/pgSQL when beneficial
[ ] Leveraging PostgreSQL's advanced SQL features
[ ] Using PostgreSQL specific optimization techniques
[ ] Implementing proper error handling in functions
Security and Compliance
[ ] Row Level Security (RLS) implementation where needed
[ ] Proper role and privilege management
[ ] Using PostgreSQL's built in encryption functions
[ ] Implementing audit trails with PostgreSQL features
📝 PostgreSQL Specific Review Guidelines
1. Data Type Optimization : Ensure PostgreSQL specific types are used appropriately
2. Index Strategy : Review index types and ensure PostgreSQL specific indexes are utilized
3. JSONB Structure : Validate JSONB schema design and query patterns
4. Function Quality : Review PL/pgSQL functions for efficiency and best practices
5. Extension Usage : Verify appropriate use of PostgreSQL extensions
6. Performance Features : Check utilization of PostgreSQL's advanced features
7. Security Implementation : Review PostgreSQL specific security features
Focus on PostgreSQL's unique capabilities and ensure the code leverages what makes PostgreSQL special rather than treating it as a generic SQL database.