安装sudo pacman -S postgresql

查看版本sudo postgres --version

设置postgres的密码sudo passwd postgres

初始化数据库```sudo su - postgres -c “initdb –locale en_US.UTF-8 -E UTF8 -D ‘/var/lib/postgres/data’”

1
2
3
4
5
6

启动数据库```systemctl start postgresql.service```

设置服务开机自启动```systemctl enable postgresql.service```

创建数据库用户tellw,并允许其访问postgresql,那么在使用postgresql数据库shell的时候无需指定用户登录

sudo su - postgres
createuser –interactive

```

创建数据库createdb test

连接数据库psql -d test

参考链接:PostgreSQL | Arch Linux安装PostgreSQL

创建于2023.2.11/14.34,修改于2023.2.11/14.34