Search Postgresql Archives

pgplsql and arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux