one pl/pgsql question
От | Ewald Geschwinde |
---|---|
Тема | one pl/pgsql question |
Дата | |
Msg-id | 3C498EC0.7060706@geschwinde.net обсуждение исходный текст |
Ответы |
Re: one pl/pgsql question
|
Список | pgsql-novice |
CREATE FUNCTION cashint(int4) RETURNS text AS ' DECLARE value ALIAS for $1; result text; BEGIN result=value::text; RETURN result; END; ' LANGUAGE 'plpgsql'; select cashint(2); cashint --------- 2 (1 row) this is correct nut when I' trying to get an array as return value it throws an error CREATE FUNCTION cashint(int4) RETURNS text[] AS ' DECLARE value ALIAS for $1; result text[]; BEGIN result[1]=value::text; RETURN result; END; ' LANGUAGE 'plpgsql'; select cashint(2); NOTICE: plpgsql: ERROR during compile of cashint near line 5 ERROR: parse error at or near "[" Is an array in this use not supported or am I totally wrong? Ewald
В списке pgsql-novice по дате отправления: