Fix plpgsql named-cursor-parameter feature for variable name conflicts.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 05dbd4a7734e09bd1f835f4197d9befa1c00c4f3
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2012-04-05T01:50:31Z
Releases: 9.2.0
Fix plpgsql named-cursor-parameter feature for variable name conflicts.

The parser got confused if a cursor parameter had the same name as
a plpgsql variable.  Reported and diagnosed by Yeb Havinga, though
this isn't exactly his proposed fix.

Also, some mostly-but-not-entirely-cosmetic adjustments to the original
named-cursor-parameter patch, for code readability and better error
diagnostics.

Files

PathChange+/−
src/pl/plpgsql/src/gram.y modified +22 −17
src/test/regress/expected/plpgsql.out modified +19 −0
src/test/regress/sql/plpgsql.sql modified +15 −0