CentOS6.2にpostgresql9.1入れる

# wget http://yum.pgrpms.org/9.1/redhat/rhel-6-x86_64/postgresql91-9.1.3-1PGDG.rhel6.x86_64.rpm
# wget http://yum.pgrpms.org/9.1/redhat/rhel-6-x86_64/postgresql91-libs-9.1.3-1PGDG.rhel6.x86_64.rpm
# wget http://yum.pgrpms.org/9.1/redhat/rhel-6-x86_64/postgresql91-server-9.1.3-1PGDG.rhel6.x86_64.rpm
# wget http://yum.pgrpms.org/9.1/redhat/rhel-6-x86_64/postgresql91-devel-9.1.3-1PGDG.rhel6.x86_64.rpm
# rpm -ivh --test postgresql91-*
# chkconfig --list | grep postgres
postgresql-9.1  0:off   1:off   2:off   3:off   4:off   5:off   6:off
# chkconfig postgresql-9.1 on
# chkconfig --list | grep postgres
postgresql-9.1  0:off   1:off   2:on    3:on    4:on    5:on    6:off
# /etc/init.d/postgresql-9.1 initdb
# /etc/init.d/postgresql-9.1 start
# su - postgres
-bash-4.1$ psql -l
                                         データベース一覧
   名前    |  所有者  | エンコーディング |  照合順序   | Ctype(変換演算子) |      アクセス権
-----------+----------+------------------+-------------+-------------------+-----------------------
 postgres  | postgres | UTF8             | ja_JP.UTF-8 | ja_JP.UTF-8       |
 template0 | postgres | UTF8             | ja_JP.UTF-8 | ja_JP.UTF-8       | =c/postgres          +
           |          |                  |             |                   | postgres=CTc/postgres
 template1 | postgres | UTF8             | ja_JP.UTF-8 | ja_JP.UTF-8       | =c/postgres          +
           |          |                  |             |                   | postgres=CTc/postgres
(3)
$ createuser ymko
新しいロールをスーパーユーザにしますか? (y/n)n
新しいロールに対してデータベースを作成する権限を与えますか? (y/n)y
新しいロールに対して別のロールを作成する権限を与えますか? (y/n)n
# su - ymko
$ createdb testdb
$ psql -l | grep test
 testdb    | ymko     | UTF8             | ja_JP.UTF-8 | ja_JP.UTF-8       |
  • 続いてDBD::Pg入れる(pg_configにパスが通ってないとエラー)
$ echo "PATH=$PATH:/usr/pgsql-9.1/bin" >> ~/.bashrc
$ source ~/.bashrc
$ cpanm DBD::Pg