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