Search Postgresql Archives

function param and declared variable of same name

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

 



Tested in 8.2 and 9.0.1

In plpgsql, if you have a function parameter and a variable of the same name, it ignores the value passed in and initializes the variable to null.
The correct action, IMO, would be to raise an error.

create or replace function test1(x int) returns int as
$$
declare x int;
begin
    return x;
end;
$$ language 'plpgsql';

Thanks
Sim

[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