postgresql extracting function source

前端 未结 1 847
感情败类
感情败类 2021-01-25 20:07

Need to extract the source of a PostgreSQL function using SQL.

I am seeing this odd behavior with one of the function, all other functions (around 200+ ) work absolutel

相关标签:
1条回答
  • 2021-01-25 20:49

    if you look on definition of information_schema.routines, then you can find following filter:

    FROM pg_namespace n, pg_proc p, pg_language l, pg_type t, pg_namespace nt
     WHERE n.oid = p.pronamespace AND p.prolang = l.oid AND p.prorettype = t.oid 
       AND t.typnamespace = nt.oid AND (pg_has_role(p.proowner, 'USAGE'::text) 
        OR has_function_privilege(p.oid, 'EXECUTE'::text));
    

    so my theory:

    • there are some issue in rights and ownership of related function (probably) - try to use different account for validation of this theory (postgres is best)
    0 讨论(0)
提交回复
热议问题