Postgresql 获取有关具有表的函数的元数据。postgres中的列%type参数
是否有可能找出postgres函数中的参数是否定义为Postgresql 获取有关具有表的函数的元数据。postgres中的列%type参数,postgresql,metadata,Postgresql,Metadata,是否有可能找出postgres函数中的参数是否定义为 table.column%type foo 或 例如,查询pg_proc?在pg_proc中的proargtypes列是所有函数参数类型的数组。然后,每种类型都可以交叉引用到pg\u type.oid 因此,如果我定义这样一个函数: steve@steve@[local] =# create function testfunc(pg_proc.proname%type) returns boolean language 'sql' immu
table.column%type foo
或
例如,查询pg_proc?在
pg_proc
中的proargtypes
列是所有函数参数类型的数组。然后,每种类型都可以交叉引用到pg\u type.oid
因此,如果我定义这样一个函数:
steve@steve@[local] =# create function testfunc(pg_proc.proname%type) returns boolean language 'sql' immutable strict as $$ select true $$;
NOTICE: type reference pg_proc.proname%TYPE converted to name
CREATE FUNCTION
嗯,这个通知不太有希望
该函数的pg_proc条目为:
proname | proargtypes
----------+-------------
testfunc | 19
第19类只是“名字”。看来这里的答案是“不”
proname | proargtypes
----------+-------------
testfunc | 19