Useful psql commands:
How to start/quit the program
$ psql database_name
: Start psql with database name.\q
: Quit psql
General
\l
: List all databases\dt
: List tables/relations\d <table_name>
: List info about a table
Display
\x
: Turn on extended display (useful forselect * from <large_table>
type queries or for fields with long fields.)\pset pager
: Toggle pager (it gets annoying sometimes)\timing
: Turn on/off query time display
Help
\h
: Help on SQL Syntax\?
: List psql slash commands