PostgreSQL and SQL Engineering Profile
Use this profile only after repository discovery identifies the stack. Read focused checks when stack-specific gates or hazards determine the result.
Read query plans when diagnosing query behavior from supplied SQL and plan evidence.
Workflow
- Discover migration directories, schema definitions, SQL files, database test harnesses, version declarations, and repository scripts.
- Follow repository-defined commands and pinned tool versions before suggesting defaults.
- Review idiomatic design and material hazards, especially null semantics, implicit casts, transaction boundaries, lock duration, deadlocks, write amplification, missing indexes, unstable ordering, timezone errors, and privilege escalation.
- Select proportionate gates from repository migration checks, parsing or linting, disposable-database tests, query-plan inspection, reconciliation checks, and rollback exercises when configured and authorized.
- Review compatibility across PostgreSQL version, extension availability, online schema-change behavior, client drivers, replicas, generated columns, constraints, and data backfills.
- Report every missing tool, skipped command, unsupported platform, or unavailable environment as incomplete rather than passing.
Boundaries
- Do not invent one universal command or replace repository policy with generic preferences.
- Do not install, upgrade, publish, deploy, apply, or mutate shared state merely to run a gate.
- Repository scripts and tests run code, and dependency checks can contact registries. Run a gate only when the user asked for checks and trusts the repository. Otherwise, name it as the next safe gate.
- Separate static review, executed checks, build evidence, provider state, and live behavior.
Output
Lead with the answer. Use the shortest format that retains the required evidence and limits; expand when requested or needed. The items below describe required content, not mandatory headings.
Return Discovery, Hazards, Commands selected, Results, Compatibility, Missing evidence, and Next safe gate.
Example
Synthetic example; not an observed client result.
Input: A new index is proposed for a slow query without its plan or workload.
Output: Index benefit is unverified. Inspect the query plan and write workload before recommending the index; do not alter shared data to test the idea.
1---2name: stack-postgresql-sql3description: "Reviews PostgreSQL schemas, queries, indexes, transactions, and migrations when database changes need focused checks; does not mutate shared data merely to validate a proposal."4license: MIT5metadata:6 source: https://skillmd.com/skills/jovanipink/stack-postgresql-sql7 author: "Measured Studios"8 version: "0.19.0"9 plugin: "measured-stacks"10 invocation: "implicit"11 provenance: "original"12 risk_class: "read-only"13---1415# PostgreSQL and SQL Engineering Profile1617Use this profile only after repository discovery identifies the stack. Read [focused checks](references/checks.md) when stack-specific gates or hazards determine the result.1819Read [query plans](references/query-plans.md) when diagnosing query behavior from supplied SQL and plan evidence.2021## Workflow22231. Discover migration directories, schema definitions, SQL files, database test harnesses, version declarations, and repository scripts.242. Follow repository-defined commands and pinned tool versions before suggesting defaults.253. Review idiomatic design and material hazards, especially null semantics, implicit casts, transaction boundaries, lock duration, deadlocks, write amplification, missing indexes, unstable ordering, timezone errors, and privilege escalation.264. Select proportionate gates from repository migration checks, parsing or linting, disposable-database tests, query-plan inspection, reconciliation checks, and rollback exercises when configured and authorized.275. Review compatibility across PostgreSQL version, extension availability, online schema-change behavior, client drivers, replicas, generated columns, constraints, and data backfills.286. Report every missing tool, skipped command, unsupported platform, or unavailable environment as incomplete rather than passing.2930## Boundaries3132- Do not invent one universal command or replace repository policy with generic preferences.33- Do not install, upgrade, publish, deploy, apply, or mutate shared state merely to run a gate.34- Repository scripts and tests run code, and dependency checks can contact registries. Run a gate only when the user asked for checks and trusts the repository. Otherwise, name it as the next safe gate.35- Separate static review, executed checks, build evidence, provider state, and live behavior.3637## Output3839Lead with the answer. Use the shortest format that retains the required evidence and limits; expand when requested or needed. The items below describe required content, not mandatory headings.4041Return Discovery, Hazards, Commands selected, Results, Compatibility, Missing evidence, and Next safe gate.4243## Example4445Synthetic example; not an observed client result.4647Input: A new index is proposed for a slow query without its plan or workload.4849Output: Index benefit is unverified. Inspect the query plan and write workload before recommending the index; do not alter shared data to test the idea.