Gregory Stark <stark@enterprisedb.com> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>> This works fine in 8.2. The reason it no longer works is that "query"
>> is now a special token in the plpgsql lexer, and that means that it will
>> never be substituted for by read_sql_construct(). So it's effectively
>> a reserved word.
> Perhaps we should be throwing a more intelligible error if you have a
> parameter (or variable?) named in a way that will conflict?
Actually, it seems you already do get such a complaint if you try to
use a keyword as a variable name:
ERROR: syntax error at or near "query"
LINE 2: declare query text; ^
Not the most tremendously helpful message, maybe, but at least it's
pointing at the right place. So the problem is only for function
parameter names, which aren't lexed by plpgsql itself but by the main
parser.
regards, tom lane