Loading...
Loading...
Connect to Postgres databases, run SQL and diagnostics, inspect schemas and migrations, review query performance, and use common PostGIS or pgvector patterns.
npx skill4agent add alemar11/skills postgresscripts/postgresscripts/postgres./scripts/postgres<postgres-skill-root>/scripts/postgres<postgres-skill-root>/scripts/postgres --versionscripts/postgresscripts/bin/postgres-<os>-<arch>postgres-darwin-arm64postgres-darwin-x86_64postgres-linux-arm64postgres-linux-x86_64projects/postgres/scripts/postgres<project-root>/.skills/postgres/config.toml.skills/postgres/config.toml.skills/postgres/postgres.tomlscripts/postgrespsqlpsqldocker compose exec pg psql ...~/.agents/skills/postgres/scripts/postgresskills/~/.agents/skills<dotagents>/skills/postgres/scripts/postgresexport DB_PROJECT_ROOT="$PWD"export POSTGRES_CLI="$HOME/.agents/skills/postgres/scripts/postgres""$POSTGRES_CLI" --json doctorDB_PROFILE=local "$POSTGRES_CLI" profile testDB_PROFILE=local "$POSTGRES_CLI" query run -c "select now();"POSTGRES_CLI=/path/to/postgres-skill/scripts/postgresDB_PROJECT_ROOT=/path/to/repo "$POSTGRES_CLI" --json doctorDB_PROJECT_ROOT=/path/to/repo "$POSTGRES_CLI" profile bootstrap --saveDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" --json profile resolveDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query run -c "select now();"DB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query run -f ./query.sqlDO $$DB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query run <<'SQL'select now();SQLDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" profile testDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" schema inspectDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" profile overviewDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" schema list tablesDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query plan -c "select * from public.users limit 10;"DB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query find users --types table,columnDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" migration release --summary "Add agent-context prompt sections"DB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query find welcome --types table,columnDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query run -f db/migrations/prerelease.sqlDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query run -c "select column_name, data_type from information_schema.columns where table_schema = 'public' and table_name = 'example' order by ordinal_position;"RETURNINGDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query run <<'SQL'update public.example set payload = jsonb_set(payload, '{enabled}', 'true'::jsonb, true) where id = 1 returning id, jsonb_pretty(payload);SQLDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" migration release --summary "Add example payload field"DB_URLDB_*DATABASE_URLPOSTGRES_URLPOSTGRESQL_URLPGHOSTPGPORTPGDATABASEPGUSERPGPASSWORDPGSSLMODEPROJECT_ROOTDB_PROJECT_ROOT<project-root>/.skills/postgres/config.toml<project-root>/.skills/postgres/postgres.tomlconfig.toml.skills/postgres/config.tomlpostgres.tomlscripts/postgres<postgres-skill-root>/scripts/postgres profile bootstrapconfig.tomlset-ssl<project-root>/.skills/postgres/config.tomlpostgres.tomldoctorprofile resolveprofile bootstrap [--save]profile testprofile infoprofile overviewprofile settings autovacuum|memoryprofile versionprofile migrate-tomlpostgres.tomlconfig.toml2.0.0profile set-ssl <profile> <true|false>sslmodequery run-c-fquery explainEXPLAINANALYZEquery plan--analyzeEXPLAIN ANALYZEquery find <pattern> [--types ...]activity overview|active-queries|locks|slow|long-running|cancel|terminate|cancel-pid|terminate-pid|pg-stat-top|replication-slotsschema inspect|list|extensions|table-sizes|index-health|invalid-indexes|top-bloated-tables|missing-fk-indexes|vacuum-status|rolesschema listtablesviewsschemastriggersindexessequencesschema extensions--installed--availablemigration releasereleased/CHANGELOG.mddocs searchconfig.tomlschema_version = "2.0.0"
[defaults]
profile = "local"
[tools.postgres]
sslmode = false
migrations_path = "db/migrations"
[tools.postgres.profiles.local]
description = "Local development DB"
host = "127.0.0.1"
port = 5432
database = "app"
user = "postgres"
password = "postgres"
sslmode = false
migrations_path = "db/migrations"schema_version[meta]config.toml.skills/postgres/config.tomlpostgres.toml[defaults][tools.postgres][tools.postgres.profiles.<name>]references/postgres_best_practices/schema-design.mdreferences/postgres_best_practices/advanced-features.mdreferences/postgres_best_practices/postgis.mdreferences/postgres_best_practices/pgvector.mdIN (...)schema inspectschema table-sizesschema index-healthactivity slowquery run-fDO $$ ... $$psqlquery runPGPASSWORD=... psql -h host -U user -d app -c "select now();"DB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query run -c "select now();"query runDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query run <<'SQL'
ALTER TABLE public.example
ADD COLUMN IF NOT EXISTS description text;
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_schema = 'public'
AND table_name = 'example'
ORDER BY ordinal_position;
SQLpsql\d+ public.examplequery runpsqlDB_PROJECT_ROOT=/path/to/repo DB_PROFILE=local "$POSTGRES_CLI" query run -c "
SELECT column_name, data_type, is_nullable, column_default
FROM information_schema.columns
WHERE table_schema = 'public'
AND table_name = 'example'
ORDER BY ordinal_position;
"INSERT ... RETURNING.skills/postgres/config.toml.skills/postgres/postgres.tomlconfig.tomlDB_PROFILE[defaults].profileprofile bootstrapdocs searchreferences/postgres_guardrails.mdBEGINCOMMITmigration releasepending migration filereleased migration filereleased/references/postgres_guardrails.mdscripts/postgresprojects/postgres/Cargo.tomlscripts/postgres --versionprojects/postgres/projects/postgres/scripts/bin/postgres-<os>-<arch>projects/postgres/target/projects/postgres/.gitignore.gitignore./scripts/postgres --help./scripts/postgres --versionDB_PROJECT_ROOT=/path/to/repo <postgres-skill-root>/scripts/postgres --json doctorpostgres.tomlconfig.tomlreferences/postgres_usage.mdreferences/postgres_env.mdreferences/postgres_skill_schema.mdreferences/postgres_guardrails.mdreferences/postgres_best_practices/README.mdreferences/postgres_local_recovery.md