PostgreSQL的AnynonArray的例子

程序:

CREATE OR REPLACE FUNCTION kappend(anynonarray, anyelement) RETURNS text AS
$$
SELECT $1 || $2;
$$ LANGUAGE SQL;

调用方法(错误):

pgsql=# select kappend('def','abc');
ERROR:  could not determine polymorphic type because input has type "unknown"
pgsql=# 

调用方法(正确):

pgsql=# select kappend('def'::text,'abc'::text);
 kappend 
---------
 defabc
(1 row)

pgsql=# 

 

posted @ 2013-07-15 13:27  健哥的数据花园  阅读(229)  评论(0编辑  收藏  举报