I want to take backup of all functions in my postgres database.How to take backup of functions only in Postgres?
You can't tell pg_dump to dump only functions. However, you can make a dump without data (-s) and filter it on restoring. Note the -Fc part: this will produce a file suitable for pg_restore.
First take the dump:
pg_dump -U username -Fc -s -f dump_test your_database
Then create a list of the functions:
pg_restore -l dump_test | grep FUNCTION > function_list
And finally restore them (-L specifies the list file created above):
pg_restore -U username -d your_other_database -L function_list dump_test