Query data from tables
Build and execute command lines from standard input
Restore a PostgreSQL database from a backup file
Run a SQL query from the terminal
psql -c "SELECT * FROM tablename;"
Executes a given SQL query directly from the command line.
Query all rows from users table
psql -c "SELECT * FROM users;"
Query users with nested posts
Query with reusable fragments
Rename query results using aliases