October 2014
Intermediate to advanced
142 pages
3h 9m
English
Once the database has been launched, we can connect to PostgreSQL using a psql frontend:
psql postgres
Ideally, you connect to a database called postgres, which can be found in any database instance. Some systems don't encourage people to log in as a postgres user. Therefore, you might want to use sudo here as well to log in to PostgreSQL. If this works for you, you can make PostgreSQL display a list of existing databases, where \l will do the job:
postgres=# \x Expanded display is on. postgres=# \l List of databases -[ RECORD 1 ]-----+---------------------- Name | postgres Owner | postgres Encoding | UTF8 Collate | en_US.UTF-8 Ctype | en_US.UTF-8 Access privileges | -[ RECORD 2 ]-----+---------------------- ...