execute_postgres
Execute SQL queries against a PostgreSQL database and retrieve results as JSON. Use in readonly mode for safe SELECT queries or readwrite for full SQL access (non-production).
Instructions
Execute a SQL query against a PostgreSQL database and return rows as JSON.
Returns: {"rows": [...], "row_count": N}
Mode behaviour (per project in databases.json):
readonly — only SELECT/WITH accepted; writes are blocked before reaching the DB.
readwrite — all SQL allowed; use only on non-production projects.
Call describe_postgres_schema first to confirm table/column names. If row_count equals your LIMIT, there are likely more rows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |