列出使用特定表的函数?

时间:2014-04-07 09:21:17

标签: postgresql stored-procedures stored-functions

是否有任何查询可以列出使用特定表的所有函数? 这样的事情(只有这样:)):

SELECT function_name FROM ? WHERE table = 'my_table';

...这应该返回所有使用表'my_table'做某事的函数(SELECT,INSERT,等等)。

1 个答案:

答案 0 :(得分:0)

SELECT routine_name
FROM information_schema.routines
    JOIN information_schema.parameters ON routines.specific_name=parameters.specific_name
WHERE routines.specific_schema='public' AND routine_definition like '%table_name%'
ORDER BY routines.routine_name, parameters.ordinal_position;
相关问题