home.


Tagged: postgresql-functions


Postgresql dump all functions to a file

If you want to dump all the functions in your schema, public in the case, do this:

SELECT pg_get_functiondef(f.oid)
FROM pg_catalog.pg_proc f
INNER JOIN pg_catalog.pg_namespace n ON (f.pronamespace = n.oid)
WHERE n.nspname = 'public';

If you issue \o somefile.sql and then issue the above you’ll save the functions to a file.

postgresql postgresql-functions

Page 1 of 1