pve postgresql
Install
login to pve
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/postgresql.sh)"
assume lxc container’s id is 201, then login to container
lxc-attach 201 or ssh root@your_container_ip
reset password
sudo -u postgres psql
ALTER USER postgres WITH PASSWORD 'your_password';
create new user
CREATE USER your_username WITH PASSWORD 'your_password';
create new database
CREATE DATABASE your_database_name;
grant permission to user
GRANT ALL PRIVILEGES ON DATABASE your_database_name TO your_username;
\c your_database_name
GRANT ALL ON SCHEMA public TO your_username;