dialect-postgres

A set of rules for writing PostgreSQL SQL, the query language used by PostgreSQL databases. It covers names, dates, text, calculations, booleans, null values, grouping, and search operators.

In plain words
What is it for?
Writing read queries against PostgreSQL tables, including date grouping, case-insensitive text matching, ratios, boolean filters, conditional aggregates, and nullable values.
Why use it?
It helps queries use PostgreSQL syntax and avoid common errors such as integer division producing an integer or referencing a column alias in the wrong place.

Skill for Claude CodeCodex

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/calvinchengx/data-agent-service/dialect-postgres
Any agent
npx skills add calvinchengx/data-agent-service --skill dialect-postgres
Clone the repo
git clone --depth 1 https://github.com/calvinchengx/data-agent-service

Made for: Claude Code, Codex.

Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 371 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00015 $0.00371
Opus 5 $0.00008 $0.00186
Sonnet 5 $0.00003 $0.00074
Haiku 4.5 $0.00002 $0.00037

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

Security

Grade A, and why

dialect-postgres scanned grade A with 0 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agent/skills/dialect-postgres/SKILL.md · 18 lines

What it actually says

Applies to sources whose dialect is postgres.

  • Row ceiling: the executor appends LIMIT n. Do not write LIMIT, FETCH FIRST, or TOP (TOP is a syntax error here).
  • Identifiers: schema.table; unquoted names fold to lower case. Quote with "double quotes" only if the described column name has capitals or spaces.
  • Dates: date_trunc('month', col), extract(year from col), to_char(col, 'YYYY-MM'), col + interval '1 day', age(a, b). Minutes between timestamps: extract(epoch from (b - a)) / 60.
  • Strings: || for concatenation, length, lower; ILIKE for case-insensitive matching.
  • Division: integer / integer is integer. Cast with ::numeric before any ratio.
  • Booleans are real: WHERE flag and count(*) FILTER (WHERE cond) are idiomatic; AVG(CASE WHEN cond THEN 1.0 ELSE 0.0 END) also works for a rate.
  • Nulls: AVG/SUM skip nulls; count(col) skips, count(*) does not. coalesce when the catalog says a column is nullable and the question needs a total.
  • Grouping by an alias in GROUP BY is allowed; referencing a select alias in WHERE is not.
  • Text search or JSON operators are available but rarely what the catalog describes — prefer the described column.
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. 2d ago First seen · 18 lines · 15 tokens per session scan A 67fbf3b5a0ee

Subscribe to this mod's changes

dialect-postgres is a skill published in the GitHub repository calvinchengx/data-agent-service (0 stars, last pushed 2d ago), licensed Apache-2.0. It adds 15 tokens to every session and 371 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

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

db-query

Query the local Postgres database of the active Aspire worktree via psql.

platformplatform/PlatformPlatform · 19 tokens

retail-validate

Run the LIVE data checks against a materialized retail table and interpret the findings. Use after silver + gold exist for a mapped table in the Seshat BI repo, when someone asks to validate or reconcile a table, or when a V-RC2 / V-RC15 / V-RC16 finding appears. Invoke-and-interpret only: this skill runs retail…

Kemetra/Seshat-BI · 112 tokens

postgres

Query and manage PostgreSQL databases -- run SQL, inspect schemas, manage tables, and perform database administration.

clawdata/clawdata · 23 tokens

db-repair

Auto-fix gbrain's Postgres access so the brain stays available. When any gbrain command or MCP tool result carries a GBRAINDBACCESS marker (or an operator reports the brain database is down), run the hardcoded gbrain db-repair ladder: diagnose, apply the safe tier, verify. The action is ALWAYS the hardcoded command …

garrytan/gbrain · 96 tokens

azure-mgmt-mongodbatlas-dotnet

Manage MongoDB Atlas Organizations as Azure ARM resources using Azure.ResourceManager.MongoDBAtlas SDK. Use when creating, updating, listing, or deleting MongoDB Atlas organizations through Azure Marketplace integration. This SDK manages the Azure-side organization resource, not Atlas clusters/databases directly.

microsoft/skills · 64 tokens