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;

原文地址:https://www.cnblogs.com/timlong/p/13337580.html