文章目录
1、查看数据库
2、查看表
3、查看索引
4、用通配符模糊查询
5、显示sql执行时间
1、查看数据库
方法一、在操作系统上执行命令
$psql -l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+-----------+----------+-------------+-------------+-------------------------
db_quhaizhou | quhaizhou | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/quhaizhou +
| | | | | quhaizhou=CTc/quhaizhou
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 | =c/postgres