There are currently 2 posts.
Font size: Small - 100% (Default)  Content converter: No conversion
 
Clicks Replies
1439 1
PostgreSQL 列舉數據庫(\l)和數據表(\d)
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 1 Posted at: 6/22/15 19:52
mydb=# \l
                                    List of databases
      Name      |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
----------------+----------+----------+-------------+-------------+-----------------------
 mcu            | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 mydb           | 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 | postgres=CTc/postgres+
                |          |          |             |             | =c/postgres
 test           | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 tieba_20100706 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
(7 rows)

mydb=# \d
          List of relations
 Schema |   Name   | Type  |  Owner   
--------+----------+-------+----------
 public | capitals | table | postgres
 public | cities   | table | postgres
 public | weather  | table | postgres
(3 rows)

mydb=#
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 2 Posted at: 3/13/24 13:03
“\c 数据库名”是打开指定的数据库,相当于mysql里面的use语句。
Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
(Shortcut key: Ctrl+Enter)
Post Information
Clicks: 1439 Replies: 1
Author: 巨大八爪鱼
Last reply: 巨大八爪鱼
Last reply time: 3/13/24 13:03
Announcements