Execute a single SQL command from the shell.
Section: Connecting and Session Variables
Run one command and exit
bash
bash
psql -d appdb -c "SELECT now();"Explanation
See summary for usage details.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Connecting and Session Variables