sincecutoff.com
← all changes

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 json
render psql <databaseID-or-name> -c "<SQL query>" -o text -- --csv
render psql <databaseID-or-name> -c "<SQL query>" -o yaml

WHY 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

Check the installed version and the source before using it. Entry JSON

Report a problem with this card