--- title: PostgreSQL category: Databases --- ### Console $ psql #logs in to default database & default user $ sudo -u psql #logs in with a particular user Replace anything within `` accordingly ### Commands * Show roles: `\du` * Show tables: `\dt` * Show databases: `\l` * Connect to a database: `\c ` * Show columns of a table: `\d ` or `\d+
` * Quit: `\q` ### Creating database $ createdb databasename