Array_append does not work with Array variables in PL/pgSQL?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Array_append does not work with Array variables in PL/pgSQL?
Дата
Msg-id 200404011320.37766.josh@agliodbs.com
обсуждение исходный текст
Ответы Re: Array_append does not work with Array variables in PL/pgSQL?
Список pgsql-sql
Folks,

See if you can spot any mistake I'm making here.   I've declared the following 
array variables in a plpgsql function:
v_vals TEXT[];n_vals TEXT[];

After some manipulation, I try to synch them:

n_vals := array_append(n_vals, v_vals[arrloop]);
val_result := v_vals[arrloop];
RAISE NOTICE ''orig value %'', val_result;
val_result := array_to_string(n_vals, '', '');
RAISE NOTICE ''derived value %'', val_result;

And I get:

NOTICE:  orig value 04/01/2004
NOTICE:  derived value <NULL>
NOTICE:  orig value 04/01/2004
NOTICE:  derived value <NULL>

It seems like I cannot assign new elements to arrays inside a PL/pgsql 
function.   What gives here?  

PostgreSQL 7.4.1 on Linux.

-- 
-Josh BerkusAglio Database SolutionsSan Francisco



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Olivier Hubaut"
Дата:
Сообщение: Re: Is it normal that functions are so much faster than inline queries
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Array_append does not work with Array variables in PL/pgSQL?