Automate SQL code deployment in Postgres

Hi,

  We work on Postgresql 9.6, installed on Linux.  
We get SQL code requests coming from different teams, such as DDLs, DMLs, TCLs etc.
We have various environments such as DEV01, DEv02, ST01, ST02 and UAT.

My task is to deploy the code snippets coming from individual code requests, into all the above environments.
Currently i'm copying and pasting these scripts manually into each of the aboce environments.

Is there a way to automate this effort so that, i can change the db in a file and quickly execute the code?
pvsbandiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

earth man2Commented:
evolutionary database configuration ...
https://martinfowler.com/articles/evodb.html

you use a software configuration tool like svn or git to maintain a DDL script for each database environment.
you diff the previous script with the upversioned current one to get a change script then run that change script on the database.
pvsbandiAuthor Commented:
Thanks!
   Unfortunately, we don't have any VM tools to maintain the code.
Is there any other way of saving the connection strings in individual files and toggle through them to connect to those regions and execute the scripts during the active connections?
earth man2Commented:
git and diff are open source ?  Maybe you need a separate server if you don't have admin rights on the database machine.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pvsbandiAuthor Commented:
Thank you! Sorry, couldn't come onto EE for a while.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PostgreSQL

From novice to tech pro — start learning today.