Re: plpgsql function parameter questions
От | Tom Lane |
---|---|
Тема | Re: plpgsql function parameter questions |
Дата | |
Msg-id | 12842.999563560@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: plpgsql function parameter questions (Bruce Momjian <pgman@candle.pha.pa.us>) |
Список | pgsql-general |
>> 1. what version of pg do i need to go to in order to eliminate the '16 >> parameter maximum' restraint? Build your own version with a suitable value of FUNC_MAX_ARGS (a/k/a INDEX_MAX_KEYS) in src/include/config.h. >> 2. can i pass an array of integers to a function? can i return an array of >> integers? if so, what would the function definition look like? test71=# create function foo (integer[]) returns integer[] as ' test71'# begin test71'# return $1; test71'# end;' language 'plpgsql'; CREATE test71=# select foo('{1,2,3}'); foo --------- {1,2,3} (1 row) Actually doing any serious manipulation of an array in plpgsql might be tricky, however. In particular, I don't see any simple way to construct an array value from scratch. You might have better luck with pltcl. There are examples of array-value manipulation in pltcl's self-test, IIRC. regards, tom lane
В списке pgsql-general по дате отправления: