Метка: PostgreSQL

PostgreSQL: use database

Подключитесь к локальному PostgeSQL используя psql

[root@s ~]# su postgres
bash-4.4$ psql
psql (10.6)
Type "help" for help.

postgres=#

Подключится к БД — \c

postgres=# \c quaded
You are now connected to database "quaded" as user "postgres".
quaded=#

PostgreSQL: show databases list

Подключитесь к PostgreSQL используя psql

[root@s ~]# su postgres
bash-4.4$ psql
psql (10.6)
Type "help" for help.

postgres=#

Список баз данных — \l

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
 quaded    | 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)

postgres=#