render psql supports non-interactive queries and output formats
Introduced 2026-02-09 · score 0.99
HOW TO USE IT
When you need to run a database query from a script and capture its output, use `render psql` with `-c` and select `-o json`, `-o yaml`, or `-o text`. Pass extra `psql` flags after `--`.
render psql <databaseID-or-name> -c "<SQL query>" -o jsonrender psql <databaseID-or-name> -c "<SQL query>" -o text -- --csvrender psql <databaseID-or-name> -c "<SQL query>" -o yamlWHY THIS HELPS
Run a database query from a script and capture its output.
BEFORE THIS CHANGE
Use `render psql` to open an interactive psql session; non-interactive query execution was added in v2.8.0.
REQUIREMENTS AND LIMITATIONS
- Version: v2.8.0
- <databaseID-or-name>: Optional Render Postgres database ID or name; if omitted, interactive mode can prompt for a database.
- --command / -c (required): Execute a SQL command in non-interactive mode.
- -o (required): Select the output format: `json`, `yaml`, or `text`. These choices are alternatives.
- -- [psql args]: Pass additional flags to psql, such as `--csv`, `-t`, or `-A`.
FIRST-PARTY EVIDENCE
- https://github.com/render-oss/cli/releases/tag/v2.8.0
- https://render.com/docs/cli-reference
- https://render.com/changelog/render-cli-v2-8-0
Check the installed version and the source before using it. Entry JSON