Hello Robert,
I have been bitten by this problem many times as well.
> I wonder whether it would be possible to make PL/pgsql take :foo to
> mean the parameter named foo, and then provide an option to make that
> THE ONLY WAY to refer to the parameter foo. For
> backward-compatibility, and compatibility with (ahem) other database
> products, we probably don't want to remove the option to have foo
> mean... any damn thing named foo you can put your hands on. But it
> would be nice to at least have the option of disabling that behavior
> when compatibility is not an issue, and correctness is.
This is one of the things I wanted to start looking at for 8.5.
My idea was to optionally use : or @ (not sure which is more popular) to
specify this token is only a variable. Do not try to match it to columns or
other database object. If the variable did not start with : or @ then normal
rules would apply for backwards compatibility.
No idea how feasible this plan is, I was just hoping to find a way to solve this
problem.
Thanks,
- Ryan