pgplsql and arrays

Поиск
Список
Период
Сортировка
От Dan Str
Тема pgplsql and arrays
Дата
Msg-id 7de955570802201017r5004305av8d3fd413d97ff7@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi List !

I have a problem with defining an array in pl/pgsql using an already defined column in a table.
Is it possible to define an array ( v_var1 ) as in my example below:

If it is not possible now it would be really nice to have in a future release , maybe something for 8.4 wishlist ?

create table test1
(
    test_id int not null,
    amount int not null,
    constraint pk_test_id primary key (test_id)
);

create or replace function
test1_func( t_id test1.test_id%TYPE )
returns int as $$
declare
    v_var1 test1.amount%TYPE[];
    -- v_var1 int[];
    v_var2 test1.amount%TYPE;
begin
    v_var1[1] := 1;
    v_var2 := 1;
    return 1;
end;
$$ language plpgsql;


Best Regards
DS

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

Предыдущее
От: "Postgres User"
Дата:
Сообщение: Re: Regex query not using index
Следующее
От: "Kynn Jones"
Дата:
Сообщение: Vacuous errors in pg_dump ... | pg_restore pipeline