Skip to content

Instantly share code, notes, and snippets.

@kishorevaishnav
Created September 15, 2016 18:50
Show Gist options
  • Save kishorevaishnav/15945605da1e9c520ce803a593ede953 to your computer and use it in GitHub Desktop.
Save kishorevaishnav/15945605da1e9c520ce803a593ede953 to your computer and use it in GitHub Desktop.
ALTER FUNCTION OWNER
SELECT 'ALTER FUNCTION '||p.proname || '('||oidvectortypes(p.proargtypes)||') OWNER TO "'||current_catalog||'";'
FROM pg_catalog.pg_proc p
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
WHERE pg_catalog.pg_function_is_visible(p.oid)
AND n.nspname <> 'pg_catalog'
AND n.nspname <> 'information_schema'
AND p.probin IS NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment