May 2017
Beginner
416 pages
10h 37m
English
So far, you have seen that data is streamed as superuser. However, it is not a good idea to allow super access from a remote side. Fortunately, PostgreSQL allows you to create a user that is only allowed to consume the transaction log stream but cannot do anything else.
Creating a user just for streaming is easy:
test=# CREATE USER repl LOGIN REPLICATION; CREATE ROLE
By assigning replication to the user it is possible to use it just for streaming—everything else is forbidden.
It is highly recommended to not use your superuser account to set up streaming. Simply change the recovery.conf file to the newly created user. Not exposing superuser accounts will dramatically improve security (just like giving the replication user ...
Read now
Unlock full access