1

I was wondering if there is a better way to deploy changes to several Postgres databases on multiple servers. I have been using Ansible for this task, I have a playbook that basically copies the changes to the server, applies them to the databases, and collect the logs using psql:

psql -v ON_ERROR_STOP=1 -f my_changes.sql > log.out 2> log.err

But I have some problems with this approach with the INDEX creations. Sometimes it takes several minutes or hours to create the index and I need to use background jobs with ansible using async & poll to allow Ansible run long tasks wihtout close the ssh connection. Also, I think I am using Ansible wrong since it is a configuration tool and this kind of task always reflect a change on the server...

Hoping you guys can tell me better approaches, tools( I heard that pgbarman can also deploy changes) or improvements on my current solution

asked Oct 30, 2021 at 11:57

1 Answer 1

0

I did a search for

apply schema changes to multiple PostgreSQL databases

...and in the results I found this little gem:

A possible candidate for your situation.

Disclaimer
I in no way endorse the product, nor am I in any way related to the software vendor

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.