Allow plpgsql function parameter names to be qualified with the function's

name.  With this patch, it is always possible for the user to qualify a
plpgsql variable name if needed to avoid ambiguity.  While there is much more
work to be done in this area, this simple change removes one unnecessary
incompatibility with Oracle.  Per discussion.
This commit is contained in:
Tom Lane
2007-07-16 17:01:11 +00:00
parent 9f6f51d5d4
commit ae1b7e298c
7 changed files with 104 additions and 28 deletions

View File

@ -2535,3 +2535,25 @@ select * from sc_test();
drop function sc_test();
-- test qualified variable names
create function pl_qual_names (param1 int) returns void as $$
<<outerblock>>
declare
param1 int := 1;
begin
<<innerblock>>
declare
param1 int := 2;
begin
raise notice 'param1 = %', param1;
raise notice 'pl_qual_names.param1 = %', pl_qual_names.param1;
raise notice 'outerblock.param1 = %', outerblock.param1;
raise notice 'innerblock.param1 = %', innerblock.param1;
end;
end;
$$ language plpgsql;
select pl_qual_names(42);
drop function pl_qual_names(int);