1、热备
select pg_start_backup('basebackupforstandby');
select pg_stop_backup(),current_timestamp;
2、主备同步检测
select pg_current_xlog_location();
select pg_switch_xlog();
select pg_last_xlog_receive_location();
3、状态查询
select pg_is_in_recovery();
4、创建、修改
create extension dblink;
create user repli relpication connection limit 2 encrypted password 'sss';
alter user sss superuser;
alter user sss encrypted password 'sss';
5、 postgreSQL信息查询
表空间: \db
模式 : \dn
用户 : \du
函数 : \df
6、postgresql配置文件
cp -i %p /u01/pg9.1/archivelog%f
host replication repli 192.168.195.201/24 md5