进入数据库 pgsql -U pgsql -d test
列出出数据库 \l
列出表 \d
切换数据库 \c test
删除数据库 drop database test
删除表 drop table xxx
查看表详细结构 \d+
查看表内容 selet * from xxx
插入记录 inser into table_name(column...)value(value...)
更新记录 update table_name set "colume1"='value1' "colume2"='value2' where "id"='1';
查看数据库表专用空间 \dt+
查看数据库占用空间 select pg_database_size('数据库名')
selet pg_size_pretty(select pg_database_size('数据库名'))
切换数据库 \c
清理数据库表缓存 vacuum FULL 表名