Postgres
Read-only PostgreSQL query skill that targets the right database by description and blocks writes.
- CCM score
- 67 of 100
- skills.sh installs
- 645
- GitHub stars
- 462
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers listing databases, browsing tables and schemas, and running single SELECT, SHOW, EXPLAIN, or WITH queries
- Provides
--list,--tables,--schema,--query, and--limitflags viascripts/query.pyfor multiple configured connections - Enforces a read-only session, a 30-second statement timeout, and a 10,000-row cap per query
- Designed for analysts who need to explore PostgreSQL data without risking writes to production
Install
$ npx -y skills add sanjay3290/ai-skills --skill postgres -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
PostgreSQL Read-Only Query Skill
Execute safe, read-only queries against configured PostgreSQL databases.
Requirements
- Python 3.8+
- psycopg2-binary:
pip install -r requirements.txt
Setup
Create connections.json in the skill directory or ~/.config/claude/postgres-connections.json.
Security: Set file permissions to 600 since it contains credentials:
chmod 600 connections.json
{
"databases": [
{
"name": "production",
"description": "Main app database - users, orders, transactions",
"host": "db.example.com",
"port": 5432,
"database": "app_prod",
"user": "readonly_user",
"password": "your-password",
"sslmode": "require"
}
]
}
Config Fields
Details
- Repository
- github.com/sanjay3290/ai-skills
- Category
- Databases
- License
- Apache-2.0
- First seen
- Jun 3, 2026
Questions
What does the postgres skill let an agent do with PostgreSQL databases?
The postgres skill lets an agent run read-only SQL queries against one or more PostgreSQL databases, explore table lists and schemas, and check database contents. It only allows SELECT, SHOW, EXPLAIN and WITH queries and blocks write operations such as INSERT, UPDATE, DELETE and DROP.
How do I install the postgres skill?
Run npx -y skills add sanjay3290/ai-skills --skill postgres -y in a project to install it. The skill needs Python 3.8 or newer and the psycopg2-binary package, plus a connections.json file that lists your database connection details.
Which skills lead the Databases category, and how does postgres compare?
Other skills in the Databases category on Claude Marketplaces include supabase-postgres-best-practices and several Prisma skills. The postgres skill differs because it focuses on safe, read-only querying across multiple configured databases, with each connection described so the agent can pick the right one.
Is it safe to let an agent query my production database with this skill?
The skill connects in PostgreSQL read-only mode, rejects multiple statements per query, and enforces a 30-second timeout and a 10,000-row cap. It also recommends setting connections.json to file permission 600 because the file holds credentials, and using a read-only database user.
How do I set up database connections for the postgres skill?
Create connections.json in the skill directory or at ~/.config/claude/postgres-connections.json, listing each database with a name, a description, host, database name, user and password. The description is used to auto-select the right database for a user's question.
More from sanjay3290/ai-skills
All 20Similar to Postgres
More DatabasesmysqlSkillsanjay3290/ai-skills426 installsRead-only MySQL query skill for multiple configured databases, with description-based auto-selection and write blocking.
mssqlSkillsanjay3290/ai-skills553 installsRead-only SQL Server querying across multiple configured databases, with description-based database selection and write blocking.
DBHubMCP serverbytebase4K starsGateway to seven SQL databases: run queries, explore schemas, and check query plans.
DbxMCP servert8y231.8K starsRead and write access to DBX-configured databases: list connections, tables, and schemas, and run SQL.
supabase-postgres-best-practicesSkillsupabase/agent-skills496.8K installsPostgres best-practices guide covering query performance, connections, RLS, schema, locking, and advanced features.
sql-queriesSkillphuryn/pm-skills3K installsNatural-language to SQL generator that reads schema files and targets BigQuery, PostgreSQL, MySQL, and other dialects.