pg_run_query
Execute a single read-only SQL statement (SELECT/WITH/EXPLAIN/SHOW) on PostgreSQL and get results. Rejects writes, multi-statements, and transaction commands before reaching the database.
Instructions
Run a single read-only SQL statement (SELECT / WITH / EXPLAIN / SHOW) against the configured PostgreSQL database and return the rows.
Rejects anything that isn't exactly one plain read-only statement — multiple statements, transaction-control keywords (COMMIT, ROLLBACK, BEGIN, ...), and any write/DDL/admin keyword anywhere in the query are all refused before the query is sent to the database. Results are capped at PG_GUARD_ROW_LIMIT rows (default 1000).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes |