Search code examples
postgresqlherokurealmheroku-postgres

Realm Data Connector with Heroku Postgres: must be superuser or replication role to use replication slots


I'm following Realm Postgres Connector reference for syncing our Realm database with our Heroku PostgreSQL database: https://docs.realm.io/platform/using-synced-realms/server-side-usage/data-integration/postgres-connector#realm-data-adapter

It's working fine locally as I could connect to the PG local database withsuperuser role in order to use replication slots. However, superuser or replication roles cannot be set on Heroku PostgreSQL database, hence leading to the following PG error:

PGRES_FATAL_ERROR: ERROR: must be superuser or replication role to use replication slots

Does anybody already got Realm Postgres Connector working with a Heroku PG database? Or could think of a workaround?

Thanks for your help!

Lucas


Solution

  • Heroku support confirmed that there is currently no way to use replication roles:

    Unfortunately, we do not allow creation of new replication slots by customers, as replication users are very privileged in Postgres, almost to the superuser level.

    Hence I've decided to migrate to Amazon RDS. Here is a great article on how to perform such migration: https://www.lewagon.com/fr/blog/how-to-migrate-your-heroku-postgres-database-to-amazon-rds