Postgres 切换数据库

Check the databases

postgres=# l
                                        List of databases
   Name    |    Owner     | Encoding |   Collate   |    Ctype    |       Access privileges
-----------+--------------+----------+-------------+-------------+-------------------------------
 edb       | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 postgres  | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/enterprisedb              +
           |              |          |             |             | enterprisedb=CTc/enterprisedb
 template1 | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/enterprisedb              +
           |              |          |             |             | enterprisedb=CTc/enterprisedb
(6 rows)

Switch database to  edb

postgres=# c edb
You are now connected to database "edb" as user "enterprisedb".
edb=#
原文地址:https://www.cnblogs.com/audiclouddba/p/7644082.html