Can HA proxy be used to proxy postgres replication connections?

Hi!

We have a use case where we need to proxy the AWS RDS postgres instance on to a virtual machine on google cloud. From there we are attempting to set replication between the cloudsql postgres instance on GCP and RDS instance which is as mentioned proxied on to a specific port(for instance 6434) VM on GCP.

I have attempted to use pgBouncer for this use case but later figured out that it does not support replication connections. I was curious if I HA proxy supports proxying replication connections?

Please let me know your thoughts. Many thanks in advance. 

Thanks,
Sajan Gone

Haproxy forwards TCP payload from one socket to another. TCP protocols therefor work.

Whether Postgres replication connections use TCP or something else, I don’t know.

I’ve set up Postgres clustering similar to what this JFrog article describes. Not sure if that helps.

You might also try using AWS DMS, which is meant to replicate data across databases, and it might be able to achieve what you intend. From personal experience, I had to make sure the base schema matched before using DMS to replicate the data. That may have changed in the last year or so.