I've gotten a case that I need to replicate data from Cloud SQL for PostgreSQL to an external on-premise PostgreSQL DB. I've read the document and found that Cloud SQL for PostgreSQL does not support external replication yet. I've tried to search for a solution on the internet but was unlucky to find one. Does anyone have an idea on how to do this? 3rd party solution is also welcome.


The functionality is indeed not yet supported. Until it is, one workaround would be to schedule exports at regular intervals to a storage solution, and then import the dumps to the on-premise database. Here is how:

1- Create a Cloud Storage bucket into which the export dumps will be stored

2- Create a Cloud Function which will connect to Cloud SQL and coordinate the export operation to the Cloud Storage bucket

3- Use Cloud Scheduler to configure the Cloud Function to trigger at regular intervals

4- Use your desired method for importing the regular dumps to the on-premise database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.