Psql is a command line program that acts as the primary front-end to a Postgresql database. It provides a number of shell commands (pg_dump to dump the content of a database, createdb to create a database, and many others). It also has a number of meta commands to list elements and display information (see the Psql cheatsheet information box).
Connecting through the command line
Psql cheatsheet:
q: Quit/Exit
d __table__: Show table definition, including triggers
dt : List tables
df: List functions
dv: List views
x: Pretty-format query results instead of the not-so-useful ASCII tables
connect __database__: Connect to a database
l: List databases
Adding a + on a d command will show more results: compare, for instance, d titanic with d+ titanic ...
Get Effective Amazon Machine Learning now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.