centos7 postgresql9.4linux
根據官網:https://www.postgresql.org/download/linux/redhat/git
yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
yum install postgresql96
yum install postgresql96-server
git clone https://github.com/postgrespro/pg_pathman
make USE_PGXS=1 make USE_PGXS
若是報錯pg_config不存在,則安裝pg_cofiggithub
yum install postgresql96-devel
打開postgresql.conf:將shared_preload_libraries配置改成以下 shared_preload_libraries = 'pg_pathman'
create user xxx
alter user xxx with password 'xxx';
CREATE EXTENSION pg_pathman; SELECT create_hash_partitions('bbs_reply', 'thread_id', 128); #bbs_reply表名,thread_id字段名,128分表數量