Skip to content

Feat: added a field for replication grants for roles#313

Open
Simon-Lind-glitch wants to merge 1 commit intomovetokube:masterfrom
Simon-Lind-glitch:feat/replication
Open

Feat: added a field for replication grants for roles#313
Simon-Lind-glitch wants to merge 1 commit intomovetokube:masterfrom
Simon-Lind-glitch:feat/replication

Conversation

@Simon-Lind-glitch
Copy link
Copy Markdown

Add replication flag to PostgresUser

Adds a replication: true flag to the PostgresUser CRD. The use case is tools like Debezium that need a user with the replication attribute to manage logical slots and stream data using logical slots for CDC.

The implementation is cloud-provider aware. On standard Postgres, GCP and Azure it uses ALTER ROLE x WITH REPLICATION. On AWS RDS it grants rds_replication instead since RDS doesn't support ALTER ROLE for this attribute. See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.FeatureSupport.LogicalReplication.html

Example usage:

apiVersion: db.movetokube.com/v1alpha1
kind: PostgresUser
metadata:
name: debezium
spec:
role: debezium
database: my-db
secretName: debezium-secret
privileges: READ
replication: true

@Simon-Lind-glitch
Copy link
Copy Markdown
Author

Maybe it should be called withReplication to more clearly reference the default way of assigning it to a role

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant