postgresql操作手册'*' port = 5432 # vi /var/lib/pgsql/13/data/pg_hba.conf #pg-13版本,添加以下一行表示允 许所有客户端ip远程连接 #若修改了存储路径,则在新的路径下/data_pg/data/pg_hba.conf host all all 0.0.0.0/0 password '*' port = 5432 # vi /var/lib/pgsql/data/pg_hba.conf #pg-10版本,添加以下一行表示允许 所有客户端ip远程连接 #若修改了存储路径,则在新的路径下/data_pg/data/pg_hba.conf host all all 0.0.0.0/0 password #提示符=>前的postgres表示当前数据库名 # psql -h x.x.x.x -p 5432 -U cof -d db_test #使用cof用户登录pg,连接 db_test这个库 db_test=> #提示符 => 表示普通账号,=#表示管理员账号 db_test=>0 码力 | 17 页 | 445.84 KB | 1 年前3
PostgreSQL 开发最佳实践rollback; • create index CONCURRENTLY idx on tbl(id); • 密码复杂度、认证方法 • 业务系统,开发测试账号,不要使用数据库超 级用户。 • 长连接relcache , syscache • 数据隔离(cluster -> database -> schema) • 主备切换(prewarm) 2016Postgres中国用户大会 hash index, unlogged table使用注意 • AD LOCK,秒杀、消除并发数据冲突 • count(*) 是否存在数据? perform limit 1(FOUND) • 短连接,连接池 • 频繁创建、删除临时表(10.0 ROADMAP) • explain评估结果集, instead count(*)(分页数) • 分页优化cursor instead order by0 码力 | 16 页 | 381.36 KB | 1 年前3
共 2 条
- 1













