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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can query the pg_proc
table to get all the UDFs available.
Filter by name
You can filter by name using the proname
column:
SELECT * FROM pg_proc WHERE proname ILIKE '%<name_here>%';
Filter by parameter type
You can filter by parameter types using the proargtypes
column:
SELECT * FROM pg_proc WHERE proargtypes = 1043;
Here, 1043
is varchar
as can be seen by querying the pg_type
table:
SELECT * FROM pg_type WHERE typname ILIKE '%char%';
Filter by parameter name
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
标签:
amazon-redshift