I often need in command line to get the code of function, so I make a patch for pg_dump, thanks this patch pg_dump is able to dump only one functions or all the functions.
The argument is --object or -B
Example: ./pg_dump -Bfunction:test_it -Bfunction:dblink_open To dump the functions test_it, dblink_open ./pgdump --object=function or pg_dump -Bfunction to dump only the functions
It is possible to add other objects, (see getObject functions)