我不知道如何在postgres数据库中获取标量函数列表。我试过编写不同的查询,但我找不到一个精确的解决方案来确定函数返回的标量类型。到目前为止,我想到的唯一解决方案是用正则表达式过滤函数返回类型的名称。
zlhcx6iw1#
如果你所说的 scalar 是指非集返回,那么系统目录pg_proc列proretset可以告诉你:demo
pg_proc
proretset
select oid::regprocedure, prorettype::regtype from pg_proc where not proretset and prokind in ('a','f','w');
字符串('a','f','w')表示聚合函数、常规函数和窗口函数。值得看一下返回类型,因为根据上面假设的定义,returns void、returns trigger、returns cursor也是标量函数。标准information_schema.routines不以任何方式区分标量和非标量函数。
('a','f','w')
returns void
returns trigger
returns cursor
information_schema.routines
1条答案
按热度按时间zlhcx6iw1#
如果你所说的 scalar 是指非集返回,那么系统目录
pg_proc
列proretset
可以告诉你:demo字符串
('a','f','w')
表示聚合函数、常规函数和窗口函数。值得看一下返回类型,因为根据上面假设的定义,returns void
、returns trigger
、returns cursor
也是标量函数。标准
information_schema.routines
不以任何方式区分标量和非标量函数。