5

I am trying to connect to Cloud SQL postgres using Debezium Postgres connector. And I am getting the following error in logs.

connect_1    | org.apache.kafka.connect.errors.ConnectException: org.postgresql.util.PSQLException: FATAL: must be superuser or replication role to start walsender
connect_1    |  at io.debezium.connector.postgresql.PostgresConnectorTask.start(PostgresConnectorTask.java:127)

It occurred to me that I need to add REPLICATION to my user role. However, CloudSQL docs say the following.

When you create a new Cloud SQL for PostgreSQL instance, the default postgres user is already created for you, though you must set its password. The postgres user is part of the cloudsqlsuperuser role, and has the following attributes (privileges): CREATEROLE, CREATEDB, and LOGIN. It does not have the SUPERUSER or REPLICATION attributes.

Now because of this, I can't ALTER ROLE to add REPLICATION

ps: the cloud SQL instance is configured for high availability.

1
  • Google Cloud SQL is a managed service. You do not get those rights. If your application requires them, then you will need to spin up your own PostgreSQL on Compute Engine. Make sure that you really do need those roles. 99% of the time you do not. Commented Oct 20, 2019 at 0:13

1 Answer 1

4

Debezium requires the Postgres wal2json extension, which is not currently supported by Cloud SQL.There is an ongoing feature request for this which you can check. You will need to setup Postgresql on GCE and setup Debezium there.

If this helps, do accept the answer

Sign up to request clarification or add additional context in comments.

3 Comments

thanks for the reply. I see the following Note from docs As of Debezium 0.10, the connector supports PostgreSQL 10+ logical replication streaming using pgoutput. This means that a logical decoding output plug-in is no longer necessary and changes can be emitted directly from the replication stream by the connector.
That is correct and there is an internal feature request to make changes to allow non super users to enable replication. Once the feature is implemented you will be able to enable replication. Hope that helps.
Cloud SQL, finally, added logical replication Aug 2021. cloud.google.com/sql/docs/postgres/release-notes#August_30_2021

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.