Skip to content

Pgsql

GiteaのデータベースをPostgreSQLにする

OSはCentOS6です。

https://qiita.com/hatayan1126/items/9b0d3be9c7ecdc207642 を参考に進めます。 この記事では9.6をインストールしていますが、せっかくなので最新の12を入れてみます。

PostgreSQLのインストール

$ sudo su
# yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# yum update
# yum install postgresql12-server
# rpm -qa | grep postgres
postgresql12-12.3-1PGDG.rhel6.x86_64
postgresql12-libs-12.3-1PGDG.rhel6.x86_64
postgresql12-server-12.3-1PGDG.rhel6.x86_64
# service postgresql-12 initdb
# cp /var/lib/pgsql/12/data/pg_hba.conf{,.bk}
# vim /var/lib/pgsql/12/data/pg_hba.conf
# diff /var/lib/pgsql/12/data/pg_hba.conf{.bk,}
80c80
< local   all             all                                     peer
---
> local   all             all                                     trust
82c82
< host    all             all             127.0.0.1/32            ident
---
> host    all             all             127.0.0.1/32            trust

# service postgresql-12 start
# chkconfig postgresql-12 --list
postgresql-12   0:off   1:off   2:off   3:off   4:off   5:off   6:off
# chkconfig postgresql-12 on
# chkconfig postgresql-12 --list
postgresql-12   0:off   1:off   2:on    3:on    4:on    5:on    6:off

Gitea用設定

https://docs.gitea.io/en-us/database-prep/#postgresql の通り

Read more