参考 https://wiki.archlinux.org/index.php/PostgreSQL

初始化

sudo -u postgres -i

PostgreSQL 命令基本都使用 postgres 用户进行操作

initdb --locale en_US.UTF-8 -E UTF8 -D '/var/lib/postgres/data'