如何在Redshift中获取UDF列表? [英] How to get a list of UDFs in Redshift?
问题描述
是否有一种简单的方法来获取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;
在这里,1043
是varchar
,这可以通过查询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屋!