psql db_name
Connecting to Database\df+
View tables\du
View users\q
: Quit/Exit\c __database__
: Connect to a database\d __table__
: Show table definition including triggers\l
: List databases\dy
: List events\df
: List functions\di
: List indexes\dn
: List schemas\dt *.*
: List tables from all schemas (if*.*
is omitted will only show SEARCH_PATH ones)\dv
: List views\df+ __function__
: Show function SQL code.\x
: Pretty-format query results instead of the not-so-useful ASCII tables\copy (SELECT * FROM __table_name__) TO 'file_path_and_name.csv' WITH CSV
: Export a table as CSV\d+ table_name
This will allow you to see table information
SELECT * FROM table_name
to view the rows of the tableDELETE FROM table_name
This will allow you to delete table rowsALTER USER user_name WITH PASSWORD 'new_password'
This will allow you to change password.