PostgreSQL: Copy Table Functions to another database schema
You can't tell pg_dump to dump functions only.  You can exclude tables, but you still have to deal with other objects (like a_horse_with_no_name said).

However, you can make a dump without data (-s) and filter it upon restoring.  Note the -Fc part: this will produce a file suitable for pg_restore, which is able to consume a custom-made table of contents.

First take the dump:

pg_dump -U username -Fc -s -n public -f dump_test your_database


Then create a list of the functions:

pg_restore -l dump_test | grep FUNCTION &gt; 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


Note that this is a nearly verbatim copy of my earlier answer on stackoverflow.