Sample Header Ad - 728x90

How do I save functions to individual files in PostgreSQL?

8 votes
3 answers
11759 views
I maintain a legacy application that uses a PostgreSQL database. The application is heavily dependent on stored procedures (aka functions). I want to save these functions to files named after the function name so I can then use a VCS (version control system). I know that I can save the code with the ALTER FUNCTION using PgAdmin but this only allows me to save one function at a time. I am looking for a way to save all the functions automatically. Is there any way to script this task?
Asked by Fernando (221 rep)
Sep 17, 2012, 11:51 PM
Last activity: Dec 19, 2018, 08:03 AM