Создаем view: CREATE OR REPLACE VIEW funcsource as
SELECT '--\012create or replace function ' ||
n.nspname::text || '.'::text || p.proname::text ||
'('::text || oidvectortypes(p.proargtypes) || ')\012'::text ||
'returns ' || t.typname || ' as \'\012' ||
p.prosrc || ' \'\012' ||
'language \'' || l.lanname || ' \';\012' as func_source,
proname as function, nspname as schema, t.typname as rettype,
oidvectortypes(p.proargtypes) as args, l.lanname as language
FROM pg_proc p, pg_type t, pg_namespace n, pg_language l
WHERE p.prorettype = t.oid AND p.pronamespace = n.oid AND p.prolang = l.oid
AND l.lanname <> 'c' AND l.lanname <> 'internal' ;
Сохраняем исходные коды функций в файл:
psql -Atc "select func_source from funcsource;" > functions.out
URL: http://www.sai.msu.su/~megera/oddmuse/index.cgi/pgsql_tips
Обсуждается: https://www.opennet.ru/tips/info/829.shtml