Setting up PostgreSQL

Published on December 29, 2020

Installation

Install PostgreSQL:

apk add postgresql postgresql-client

Configuration

Start the service:

/etc/init.d/postgresql setup
/etc/init.d/postgresql start
rc-update add postgresql

Create the PostgreSQL users and database for the Postfix database:

createuser -U postgres --pwprompt postfixadmin
createuser -U postgres --pwprompt postfix
createdb -U postgres --owner=postfixadmin postfix

Grant the postfix user access to the database:

psql -U postfixadmin postfix
GRANT SELECT ON alias TO postfix;
GRANT SELECT ON domain TO postfix;
GRANT SELECT ON mailbox TO postfix;
GRANT SELECT on alias_domain TO postfix;
\q

[ #alpine ]


If you like my work or if my work has been useful to you in any way, then feel free to donate me a cup of coffee. Any donation is much appreciated!