如何在Redshift中获取UDF列表? [英] How to get a list of UDFs in Redshift?

查看:76
本文介绍了如何在Redshift中获取UDF列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法来获取Redshift中可用的所有UDF的列表? 此外,我想找到带有参数类型的UDF,并按名称搜索UDF.

Is there an easy way to get the list of all UDFs that are available in Redshift? Moreover, I would like to find UDFs with parameter types and search for UDFs by name.

推荐答案

您可以查询pg_proc表以获取所有可用的UDF.

You can query the pg_proc table to get all the UDFs available.

您可以使用proname列按名称进行过滤:

You can filter by name using the proname column:

SELECT * FROM pg_proc WHERE proname ILIKE '%<name_here>%';

您可以使用proargtypes列按参数类型进行过滤:

You can filter by parameter types using the proargtypes column:

SELECT * FROM pg_proc WHERE proargtypes = 1043;

在这里,1043varchar,这可以通过查询pg_type表看到:

Here, 1043 is varchar as can be seen by querying the pg_type table:

SELECT * FROM pg_type WHERE typname ILIKE '%char%';

您还可以使用proargnames列按参数名称进行过滤:

You can also filter by parameter name using the proargnames column:

SELECT * FROM pg_proc WHERE proargnames = ARRAY['foo'];

参考文献:

References:

http://docs.aws.amazon.com/redshift/latest/dg/c_join_PG.html

http://www.postgresql.org/docs/8.0/static/catalog-pg-proc.html

这篇关于如何在Redshift中获取UDF列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆