ct_psql
Run SQL inside a PostgreSQL container via psql. Dry-run first for a plan and classification; confirm to execute with optional automatic snapshot for undo.
Instructions
Run SQL via psql inside a container (as the db OS user). MUTATION-CAPABLE.
Dry-run by default: without confirm=True you get a PLAN — the SQL plus a heuristic read/DML/DDL classification (advisory only) — recorded to the ledger. Re-call with confirm=True to execute.
snapshot=True (UNDO): take an auto-undo snapshot first and WAIT for it; if it can't be made the
SQL is NOT run (fail-closed). On success the result carries an undo_point (revert via pve_rollback).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Target database name. | postgres |
| sql | Yes | SQL to run via psql inside the container, as the database OS user. | |
| ctid | Yes | Numeric CTID of the container running PostgreSQL (allowlist-scoped). | |
| confirm | No | False (default) returns a dry-run PLAN; true executes. | |
| snapshot | No | Take a fail-closed auto-undo snapshot before running. | |
| proximo_target | No | Which configured Proxmox target to run this call against — a target name from your multi-target config (a specific PVE/PBS/PMG/PDM box). Omit to use the single/default target from the environment; the selection applies only to this call. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |