Postgres
From Leo's Notes
This page was last edited on 8 October 2019, at 21:56.
Client
The command-line client for PosgreSQL is psql. Connect by running psql as root or as a particular user.
Databases can be listed with \l:
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
---------------+----------+----------+-------------+-------------+-----------------------
citrix-confdb | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
A database can be selected or changed with \c.
postgres=# \c citrix-confdb
You are now connected to database "citrix-confdb" as user "postgres".
Tables can be listed with \dt:
citrix-confdb=# \dt
No relations found.