目前共有2篇帖子。 字體大小:較小 - 100% (默認)▼  內容轉換:不轉換▼
 
點擊 回復
586 1
PostgreSQL 列舉數據庫(\l)和數據表(\d)
一派掌門 二十級
1樓 發表于:2015-6-22 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=#
一派掌門 二十級
2樓 發表于:2024-3-13 13:03
“\c 数据库名”是打开指定的数据库,相当于mysql里面的use语句。
 

回復帖子

內容:
用戶名: 您目前是匿名發表
驗證碼:
(快捷鍵:Ctrl+Enter)
 

本帖信息

點擊數:586 回複數:1
評論數: ?
作者:巨大八爪鱼
最後回復:巨大八爪鱼
最後回復時間:2024-3-13 13:03
 
©2010-2025 Purasbar Ver2.0
除非另有聲明,本站採用共享創意姓名標示-相同方式分享 3.0 Unported許可協議進行許可。