Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly setup permissions to start Postgres replication?

I am trying to follow the Debezium tutorial for Postgres and set up a replication user. I am creating the replication user as follows:

CREATE ROLE replication_role WITH REPLICATION LOGIN;

CREATE USER debezium WITH PASSWORD 'my-secret-pw';

GRANT replication_role TO debezium;

CREATE ROLE replication_group WITH LOGIN;

GRANT replication_group TO postgres;

GRANT replication_group TO debezium;

ALTER TABLE person OWNER TO replication_group;

and it sets up the replication user as follows:

                                                     List of roles
     Role name     |                         Attributes                         |              Member of               
-------------------+------------------------------------------------------------+--------------------------------------
 debezium          |                                                            | {replication_role,replication_group}
 postgres          | Superuser, Create role, Create DB, Replication, Bypass RLS | {replication_group}
 replication_group |                                                            | {}
 replication_role  | Replication                                                | {}

When I try to start the Postgres source connector, I get the error as follows:

io.debezium.DebeziumException: Creation of replication slot failed
...
Caused by: org.postgresql.util.PSQLException: FATAL: must be superuser or replication role to start walsender

How do I fix the permissions issue so that I can start replicating from Postgres?

like image 700
An SO User Avatar asked Oct 31 '25 17:10

An SO User


1 Answers

ALTER USER debezium REPLICATION;
like image 151
iownthegame Avatar answered Nov 02 '25 23:11

iownthegame