Netkiller Postgresql 手札
Mr. NeoChan,陈景峰(BG7NYT)
中国广东省深圳市龙华新区民治街道溪山美地
518131
+86 13113668890
+86 755 29812080
<netkiller@msn.com>
文档始创于2012-11-16
版权 2010,2011,2012,2013 Netkiller(Neo Chan). All rights reserved.
版权声明
转载请与作者联系,转载时请务必标明文章原始出处和作者信息及本声明。
@H_403_112@ |
|
$Date: 2013-04-10 15:03:49 +0800 (Wed,10 Apr 2013) $
我的系列文档
Netkiller Architect 手札@H_403_112@ | Netkiller Developer 手札@H_403_112@ | Netkiller PHP 手札@H_403_112@ | Netkiller Python 手札@H_403_112@ | Netkiller Testing 手札@H_403_112@ | Netkiller Cryptography 手札@H_403_112@ |
Netkiller Linux 手札@H_403_112@ | Netkiller CentOS 手札@H_403_112@ | Netkiller FreeBSD 手札@H_403_112@ | Netkiller Security 手札@H_403_112@ | Netkiller Version 手札@H_403_112@ | Netkiller Web 手札@H_403_112@ |
Netkiller Monitoring 手札@H_403_112@ | Netkiller Storage 手札@H_403_112@ | Netkiller Mail 手札@H_403_112@ | Netkiller Shell 手札@H_403_112@ | Netkiller Network 手札@H_403_112@ | Netkiller Database 手札@H_403_112@ |
Netkiller PostgreSQL 手札@H_403_112@ | Netkiller MySQL 手札@H_403_112@ | Netkiller NoSQL 手札@H_403_112@ | Netkiller LDAP 手札@H_403_112@ | Netkiller Cisco IOS 手札@H_403_112@ | Netkiller H3C 手札@H_403_112@ |
Netkiller Multimedia 手札@H_403_112@ | Netkiller Docbook 手札@H_403_112@ | Netkiller 开源软件 手札@H_403_112@ | @H_403_112@ | @H_403_112@ | @H_403_112@ |
1.3. Postgresql YUM 源安装
CentOS 6.4 环境 YUM 地址 http://yum.postgresql.org/
# yum install http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm # yum list postgres* # yum install postgresql92-server postgresql92 chkconfig postgresql-9.2 on service postgresql-9.2 initdb service postgresql-9.2 start
配置文件的位置
# ls /var/lib/pgsql/9.2/data/*.conf /var/lib/pgsql/9.2/data/pg_hba.conf /var/lib/pgsql/9.2/data/pg_ident.conf /var/lib/pgsql/9.2/data/postgresql.conf
9.2 升级到 9.3
备份数据库
# su - postgres $ pg_dump -f wechat.sql wechat
# yum install http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm # yum install postgresql93-server postgresql93
关闭9.2,启动9。3
# chkconfig postgresql-9.2 off # service postgresql-9.2 stop # chkconfig postgresql-9.3 on # service postgresql-9.3 initdb # service postgresql-9.3 start
# su - postgres $ createuser -r -s -P dba $ createuser -P wechat $ createdb -E UTF8 -O wechat wechat $ cat wechat.sql | psql wechat
合并配置文件
$ cp 9.3/data/postgresql.conf{,.original} $ cp 9.3/data/pg_hba.conf{,.original} $ vimdiff 9.2/data/postgresql.conf 9.3/data/postgresql.conf $ vimdiff 9.2/data/pg_hba.conf 9.3/data/pg_hba.conf
注意 vimdiff 命令是文件对比于合并工具,建议你选择你比较熟悉的工具。
# service postgresql-9.3 restart