Working with Issues
Issues are the core of Postgres copilot. When Postgres copilot detects a problem with your Postgres database, it creates an Issue with a specific, actionable recommendation.
What is an Issue?
An Issue is not just an alert — it's a complete diagnosis with a solution. Each Issue contains:
- Title: Clear description of the problem
- Severity: Critical, High, Medium, or Low
- Area: Which monitoring area detected it (e.g., Query Performance, Indexing, Configuration)
- Recommendation: Specific fix (SQL command, config change, etc.)
- Evidence: Metrics and data supporting the recommendation
- Discussion: Comments from experts and AI analysis
Example Issue
ISSUE: Missing index on orders.customer_id
Severity: High
Area: Indexing
PROBLEM:
Sequential scans on orders table are causing slow queries.
Query "SELECT * FROM orders WHERE customer_id = ?" averages
2.3 seconds with 50,000 calls/day.
RECOMMENDATION:
CREATE INDEX CONCURRENTLY idx_orders_customer_id
ON orders(customer_id);
EVIDENCE:
- pg_stat_user_tables shows 847,293 seq_scans on orders
- 0 index scans for queries filtering by customer_id
- Estimated improvement: 2.3s → 5ms per query
TESTED:
Index creation verified on DBLab clone.
No blocking operations detected.
Viewing Issues
In PostgresAI Console
- Go to https://console.postgres.ai
- Navigate to your organization
- Click Issues in the sidebar
Issues are organized by:
- Status: Open, In Progress, Resolved
- Severity: Critical issues first
- Area: Group by monitoring area
Via API
Issues can be accessed programmatically:
# List all issues
pai issues list
# View specific issue
pai issues view <issue-id>
# Add a comment
pai issues comment <issue-id> "Scheduled for next deployment"
Issue lifecycle
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Created │────▶│ In Progress │────▶│ Resolved │
└─────────────┘ └─────────────┘ └─────────────┘
│ │
│ ▼
│ ┌─────────────┐
└───────────▶│ Ignored │
└─────────────┘
- Created: Copilot detected an issue and generated a recommendation
- In Progress: Someone is working on the fix
- Resolved: Fix has been applied and verified
- Ignored: Issue acknowledged but won't be fixed (with reason)
Turning Issues into pull requests
Using AI coding tools
Issues are designed to be consumed by AI coding assistants. You can:
- Copy the Issue details into Cursor, GitHub Copilot, or similar tools
- Ask the AI to generate the migration/PR
- Review and submit
Example workflow with Cursor
Prompt: "Create a database migration for this PostgresAI Issue:
[paste Issue details]
Use our standard migration format with up/down methods."
The AI generates:
# db/migrate/20241201_add_index_orders_customer_id.rb
class AddIndexOrdersCustomerId < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def change
add_index :orders, :customer_id,
algorithm: :concurrently,
if_not_exists: true
end
end
MCP Integration (coming soon)
PostgresAI provides an MCP server that AI tools can connect to directly, allowing them to:
- List open Issues
- Read Issue details
- Post comments and status updates
Prioritizing Issues
Not all Issues need immediate attention. Consider:
Severity levels
| Severity | Response time | Examples |
|---|---|---|
| Critical | Immediate | Disk nearly full, wraparound risk |
| High | This week | Missing indexes causing slow queries |
| Medium | This month | Suboptimal configuration |
| Low | When convenient | Minor optimizations |
Impact assessment
Each Issue includes:
- Affected queries: How many queries are impacted
- Performance impact: Estimated improvement
- Risk level: How safe is the recommended fix
Resolving Issues
When you've applied a fix:
- Update the Issue status to "In Progress"
- Add a comment with the PR/commit link
- After deployment, verify the fix worked
- Mark as "Resolved"
Postgres copilot will verify the resolution by checking if:
- The recommended change was applied
- The problem metrics improved
Ignoring Issues
Some Issues may not apply to your situation. You can ignore an Issue with a reason:
- Won't fix: Accepted behavior for your use case
- False positive: Issue detection was incorrect
- Deferred: Will address later
Ignored Issues can be reopened if circumstances change.
Issue comments and discussion
Issues support threaded comments for:
- Asking clarifying questions
- Discussing alternative solutions
- Documenting decisions
Both humans and AI can participate in Issue discussions.
Best practices
- Review Issues weekly: Don't let the backlog grow
- Start with High severity: Get the biggest wins first
- Test before deploying: Use DBLab to validate changes
- Document decisions: Add comments explaining your choices
- Track resolution: Close Issues when fixes are verified