PostgreSQL addon: optional logical replication for apps that need it
-
Some apps now need PostgreSQL logical replication. The one I've hit is wger: since version 2.0, its mobile app requires PowerSync, which reads changes from the wger database through a logical replication slot. PowerSync, ElectricSQL, Supabase Realtime, Zero and Debezium all work this way.
The addon currently can't support this. The server runs with wal_level=replica, and app roles don't have the REPLICATION attribute. Neither can be changed from inside a package, so the only option is to bundle a separate PostgreSQL in the app and give up the addon's managed backups and upgrades.
Would you consider an opt-in addon option, something like "postgresql": { "logicalReplication": true }? It would need to:
- run the server with wal_level=logical (the only cost to other apps is somewhat more write-ahead log (WAL) volume)
- grant REPLICATION to the role of each app that asks for it
- set max_slot_wal_keep_size, so an abandoned slot can't fill the shared disk
- drop the app's replication slots on uninstall and before a restore
With that, packages like wger could stay on the addon instead of each shipping its own database.
-
@loudlemur I will have to read up on this, to see what this is
-
Oh thanks for that @jdaviescoates , i had missed that note from @rolig . So, we will roll out postgres 18 next week as part of 10.1. I guess we might just wait it out instead of adding this feature flag.
-
I presume you noticed, but, 18 is not 19

that's sadly true. 19 will be released...
soonthis autumn (also, I haven't tested that change yet, only have that from the docs)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login