# PostgreSQL Secure

> Use this tool when you need to securely interact with PostgreSQL databases, providing read-only access while preventing malicious SQL activity. It solves problems related to database security, query optimization, and performance monitoring by offering features like query execution, EXPLAIN analysis, and audit logging. It takes SQL queries as input and returns query results, analysis, and logging data, making it ideal for use cases requiring secure and controlled database access.

Canonical page: https://skillsregistry.net/skills/bettyguo-postgres  
JSON: https://api.skillsregistry.net/v1/skills/bettyguo-postgres

## Description

Provides agents with read-only PostgreSQL access through schema introspection, query execution with row caps and timeouts, EXPLAIN analysis, pg_stat_statements summaries, and pgvector similarity search. Implements a layered security model: least-privilege database role as the primary guard, pglast AST parsing to reject dangerous SQL patterns, per-transaction read-only envelopes, and structured audit logging. Includes 30 adversarial payload tests validating read-only enforcement. Supports PostgreSQL 13–17 and requires Python 3.11+.

## Trust

- **Trust score (0–1):** 0.63
- **Verification tier:** scanned
- **Last scanned:** 2026-09-01

## Facts

- **Version:** 1.0.0
- **Skill type:** atomic
- **Execution layer:** mcp-remote
- **Runtime environment:** api
- **Category:** database
- **Updated:** 2026-09-01

## Source

- **Source listing:** [PulseMCP](https://www.pulsemcp.com/servers/bettyguo-postgres)
- **Repository:** <https://github.com/bettyguo/mcp-postgres>

## Use it

Resolve this record through the SkillsRegistry MCP server (no auth, read-only):

```
claude mcp add --transport http --scope user skillsregistry https://api.skillsregistry.net/mcp
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_skill",
    "arguments": {
      "slug": "bettyguo-postgres"
    }
  }
}
```

REST: `GET https://api.skillsregistry.net/v1/skills/bettyguo-postgres` · pull for local use: `GET https://api.skillsregistry.net/v1/skills/bettyguo-postgres/pull`

---
SkillsRegistry indexes agent skills from public registries and GitHub. Skills we have analysed are scanned with Circle-IR and scored on six dimensions; each listing states its scan coverage. More: https://skillsregistry.net/llms.txt
