su - postgresshow databases:
psql -lor after connect without a database selected
\lConnect to database:
psql [database] [username]Show tables:
\dDescribe table:
\d+ tableShow rows per table:
SELECT schemaname,relname,n_live_tup
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;Quit:
\q