link
Run a SQL query from the terminal
psql -c "SELECT * FROM tablename;"
Query all rows from users table
psql -c "SELECT * FROM users;"