Skip to content

PostgreSQL

CategoryDatabases
CLIpsql
AuthNone (uses psql connection parameters)

Wraps the psql CLI to give CodeBuddy access to PostgreSQL databases. The agent can execute queries, inspect schemas, run migrations, and analyze query performance.

Install the PostgreSQL client tools:

Terminal window
# macOS
brew install postgresql
# Linux (Debian/Ubuntu)
sudo apt-get install postgresql-client
# Linux (Fedora)
sudo dnf install postgresql
# Windows
winget install PostgreSQL.PostgreSQL

Verify the connection:

Terminal window
psql -h localhost -U postgres -c '\conninfo'

The skill uses standard psql connection parameters — set PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE environment variables or pass a connection string.

  • Queries — execute read and write SQL statements
  • Schema inspection — list tables, columns, indexes, constraints
  • Migrations — run migration scripts
  • PerformanceEXPLAIN ANALYZE queries, index recommendations
  • Admin — database size, active connections, lock monitoring

The skill includes a bundled install.sh for automated setup.

  • “Show me the schema for the users table”
  • “Find all orders placed in the last 7 days with a total over $100”
  • “Explain this slow query and suggest index improvements”
  • “List all tables larger than 1 GB”