infra-postgres

infra-postgres is a skill for Claude Code, Codex from ClickHouse/agent-skills. It costs 106 tokens per session (627 once invoked), scanned C, original, Apache-2.0.

A setup and operations guide for PostgreSQL databases, using the clickhousectl command-line tool. It covers local Docker-based databases for development and managed PostgreSQL services in ClickHouse Cloud.

In plain words
What is it for?
Use it to create and manage local PostgreSQL instances, or to run managed cloud databases with connections, security settings, read replicas, failover, and point-in-time restore.
Why use it?
It removes the need to work out separate steps for local development and cloud hosting. It also distinguishes development setup from cloud operations such as backups, replicas, failover, and TLS.

Skill for Claude CodeCodex

Part of the clickhouse-best-practices plugin — 11 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/clickhouse/agent-skills/infra-postgres
Any agent
npx skills add ClickHouse/agent-skills --skill infra-postgres
Clone the repo
git clone --depth 1 https://github.com/ClickHouse/agent-skills

Made for: Claude Code, Codex.

Or install clickhouse-best-practices, the plugin that ships this one along with the rest of its 11 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for infra-postgres

README.md
[![agentmods](https://agentmods.dev/badge/skills/clickhouse/agent-skills/infra-postgres.svg)](https://agentmods.dev/skills/clickhouse/agent-skills/infra-postgres)
Your own site
<a href="https://agentmods.dev/skills/clickhouse/agent-skills/infra-postgres"><img src="https://agentmods.dev/badge/skills/clickhouse/agent-skills/infra-postgres.svg" alt="Measured on agentmods" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 627 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00106 $0.00627
Opus 5 $0.00053 $0.00313
Sonnet 5 $0.00021 $0.00125
Haiku 4.5 $0.00011 $0.00063

Measured 5d ago against content hash 4abbc3f75bc3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

infra-postgres scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -fsSL https://clickhouse.com/cli | sh

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL https://clickhouse.com/cli | sh
skills/infra-postgres/SKILL.md · 52 lines

How it starts

The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Postgres with clickhousectl

clickhousectl manages Postgres in two environments:

  • Local — named, Docker-backed Postgres instances on the user's machine, for development.
  • Cloud — managed Postgres services in ClickHouse Cloud (beta), for production: HA, read replicas, point-in-time restore.

This file routes to the right reference. The step-by-step workflows live in ref/local.md and ref/cloud.md — read the one that matches the user's situation before running commands.

Which reference to use

The user wants to... Read
Develop or prototype locally, run tests/CI against Postgres, no cloud account needed ref/local.md
Go to production, host a managed Postgres, or use ClickHouse Cloud explicitly ref/cloud.md
Operate an existing cloud service (passwords, TLS, config, replicas, failover, restore) ref/cloud.md
Develop locally now, ship to production later Start with ref/local.md; it points to ref/cloud.md when it's time to go to prod

If it's genuinely ambiguous (e.g. "set up Postgres for my app"), default to local for development tasks and ask before creating anything in the cloud — cloud services cost money.

Prerequisites (both workflows)

Check that clickhousectl is installed:

which clickhousectl

If not found, install it:

curl -fsSL https://clickhouse.com/cli | sh

This installs to ~/.local/bin/clickhousectl (with a chctl alias). If the command is still not found, suggest export PATH="$HOME/.local/bin:$PATH" or a new terminal.

All commands accept --json for machine-readable output. Exit codes follow gh conventions: 0 success, 1 error, 2 cancelled, 4 auth required.

  • To replicate Postgres data into ClickHouse for analytics, see ClickPipes (clickhousectl cloud clickpipe --help).
  • For ClickHouse itself (local development or ClickHouse Cloud services), use the infra-clickhouse skill.

Read the full file on GitHub · 52 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 52 lines · 106 tokens per session scan C 4abbc3f75bc3

Subscribe to this mod's changes

infra-postgres is a skill published in the GitHub repository ClickHouse/agent-skills (530 stars, last pushed 29d ago), licensed Apache-2.0. It adds 106 tokens to every session and 627 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

postgresql-table-design

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.

wshobson/agents · 37 tokens

azure-resource-manager-postgresql-dotnet

Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "PostgreSQL", "PostgreSqlFlexibleServer", "PostgreSQL Flexible Server", "Azure Database for…

microsoft/skills · 97 tokens

azure-postgres-ts

Connect to Azure Database for PostgreSQL Flexible Server from Node.js/TypeScript using the pg (node-postgres) package. Use for PostgreSQL queries, connection pooling, transactions, and Microsoft Entra ID (passwordless) authentication. Triggers: "PostgreSQL", "postgres", "pg client", "node-postgres", "Azure PostgreSQL…

microsoft/skills · 94 tokens

dsql

Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, foreign key…

awslabs/agent-plugins · 229 tokens

database-patterns

Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning. Use when creating migrations, designing schemas, normalizing data, managing database versions, or handling schema drift.

yonatangross/orchestkit · 49 tokens

use-gfs-mcp

GFS MCP Server for AI agent integration. Provides Model Context Protocol tools for database version control with automatic schema versioning.

Guepard-Corp/gfs · 30 tokens