1
TABLE.COLUMN%类型参数的功能,是否有可能找出是否在Postgres的函数参数定义为获取元数据有关在Postgres的
table.column%type foo
或
sometype foo
查询例如pg_proc里?
TABLE.COLUMN%类型参数的功能,是否有可能找出是否在Postgres的函数参数定义为获取元数据有关在Postgres的
table.column%type foo
或
sometype foo
查询例如pg_proc里?
pg_proc
中的proargtypes
列是所有函数参数类型的数组。然后可以将每种类型交叉引用至pg_type.oid
。
所以,如果我这样定义一个函数:
[email protected]@[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型是只是 “名”。所以看起来这里的答案是“不”,恐怕。