Postgre基本命令


(1)列出所有的數據庫

mysql: show databases
psql: \l
(2)切換數據庫
mysql: use dbname
psql: \c dbname

(3)列出當前數據庫下的數據表
mysql: show tables
psql: \d

(4)列出指定表的所有字段
mysql: show columns from table name
psql: \d tablename

(5)查看指定表的基本情況
mysql: describe tablename
psql: \d+ tablename

(6)退出登錄
mysql: quit 
psql:\q

 

修改密碼:

ALTER USER postgres WITH PASSWORD 'postgres';

查看參數:

show ALL;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM