首页 > 解决方案 > Postgres 函数存在于特定模式中

问题描述

我有具有多个模式的 postgres DB,有没有一种方法(查询)我可以运行以确定函数是否存在于特定模式中,或者换句话说打印给定函数存在的模式名称列表。

标签: sqlpostgresqlfunction

解决方案


您可以调整以下查询:

select routine_name, routine_schema 
from information_schema.routines 
where routine_name='myfunction' 
and routine_type='FUNCTION';

推荐阅读