# postgres setup on centos 7 ``` yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7.7-x86_64/pgdg-redhat10-10-2.noarch.rpm yum install postgresql10-server postgresql10 /usr/pgsql-10/bin/postgresql-10-setup initdb systemctl start postgresql-10 systemctl enable postgresql-10 systemctl status postgresql-10 sudo -u postgres psql ``` Once in the psql command line: ``` postgres=# CREATE DATABASE sensu_events; CREATE DATABASE postgres=# CREATE USER sensu WITH ENCRYPTED PASSWORD 'mypass'; CREATE ROLE postgres=# GRANT ALL PRIVILEGES ON DATABASE sensu_events TO sensu; GRANT ``` Add sensu user to the pg_hba.conf