postgres 命令行基本操作

1、查看当前用户已有数据库
su postgres
psql -l
2、连接数据库db
psql db
3、查看当前库下所有的表
\d
4、查看当前表的结构
\d tablename
5、查看当前编码格式
\encoding
show encoding
6、设置当前编码格式
\encoding 'utf-8'

7、分页查询语句
select * from xxx where a>b limit 10 offset 0;

猜你喜欢

转载自qxf567.iteye.com/blog/2039911