PostgreSQL
複数ベンダがそれぞれ互換環境な商用DBをつくっていたりいなかったりして技術を持ち寄っているのかな
APIは互換性があるものが多い
Linuxディストリビューションでは標準的に利用できる 日本PostgreSQLユーザ会
台湾にもユーザ会あり
設定
設定ファイルは /etc/postgresql/15/main や /usr/lib/postgresql/15/data などどこかにある
アクセス制御に pg_hba.conf と postgresql.conf を編集する
pg_hba.conf
IPアドレスと認証方法などを制御するもの
postgresql.conf
待ち受けポート(listen_addresses)が初期 localhost なので * などに変更すると他サーバなどからも接続できたりする
code:postgresql.conf
listen_addresses='localhost,192.168.0.11,fe80::xxxx:xxxx:xxxx:xxxx'
localnetwork 系から接続できるようにしておく
pg_hba.conf
code:pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
host all all 192.168.0.0/24 scram-sha-256
host all all fe80::/64 scram-sha-256
IPv4 と IPv6 のローカルアドレスっぽい例
# systemctl restart postgresql
Docker/Podman
Dockerfile で locale と timezone などを設定するといいかも
code:Dockerfile
FROM docker.io/postgres:latest
RUN localedef -i ja_JP -c -f UTF-8 -A /usr/share/locale/locale.alias ja_JP.UTF-8
ENV LANG ja_JP.utf8