はじめに
PostgreSQL Serverの古いバージョンの検証が必要になったので
インストール手順をメモする
OS:centOS6.7
DB:PostgreSQL9.5
以下の3つをインストール
・postgresql95-libs クライアントやI/Fに必要なライブラリ
・postgresql95 PostgreSQLに接続、操作等を行うクライアント
・postgresql95-server サーバ機能(作成、起動、停止等)
手順
1.必要ファイルをダウンロードする
wget https://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/postgresql95-libs-9.5.25-1PGDG.rhel6.x86_64.rpm
wget https://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/postgresql95-9.5.25-1PGDG.rhel6.x86_64.rpm
wget https://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/postgresql95-server-9.5.25-1PGDG.rhel6.x86_64.rpm
2.インストールする
rpm -Uvh postgresql95-libs-9.5.25-1PGDG.rhel6.x86_64.rpm
rpm -Uvh postgresql95-9.5.25-1PGDG.rhel6.x86_64.rpm
rpm -Uvh postgresql95-server-9.5.25-1PGDG.rhel6.x86_64.rpm
3.初期化
service postgresql-9.5 initdb
4.DB起動
service postgresql-9.5 start
5.ユーザスイッチ
su - postgres
6.接続
psql
7.切断
\q
参考サイト
・公式のダウンロード先
https://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/repoview/
・インストールする手順の参考
https://www.kakiro-web.com/linux/centos6-postgresql-install.html
履歴
2021/7/26 作成