postgres 切换用户和数据库
postgres=> \l+List of databasesName| Owner| Encoding | Collate|Ctype|Access privileges| Size| Ta...
postgres=> \l+
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges | Size | Tablespace | Description
-----------+----------+----------+------------+------------+-----------------------+---------+------------+--------------------------------------------
postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 | | 7875 kB | pg_default | default administrative connection database
template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +| 7561 kB | pg_default | unmodifiable empty database
| | | | | postgres=CTc/postgres | | |
template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +| 7561 kB | pg_default | default template for new databases
| | | | | postgres=CTc/postgres | | |
(3 rows)
--//切换数据库
postgres=# \c template1
You are now connected to database "template1" as user "postgres".
template1=#
template1=#
--//切换用户
template1=# \c - replica
You are now connected to database "template1" as user "replica".
template1=>
更多推荐
所有评论(0)