Can I back up all stored procedures and triggers on a database?
Backup and restore
Collapse
X
-
Thank you for your suggestion,rski . I did read the pg_dump document. Just can't find exact way to do it. Finally I figure out such as following.
"pg_dump -T *.* mydb >mydb.sql"
Well which will produce a script. After delete schema creation statements and replace "create function" with "create and replace function", it becomes exactly what I needed. I'm a developer. I used a lot of stored procedures in my application for customers. After a version update, I need to upgrade customer's database without touch their data. It will be too hard to pick up every updated sp to upgrade. Instead, I think the easy way to do is just reinstall all sp. That's why I need the exact way to backup all sp.Comment
-
Don't you keep you stored procedures in a files (probably in some versioning system like cvs)?
If you do, I do not understand why do you want to get sp definitions from database?
But if you need that i think you need to write a script that will go through pg_proc table and read sp definitions.Comment
Comment