Joel Jacobson <j...@trustly.com> writes: > On Tue, Mar 4, 2014 at 12:55 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: >> You're reasoning from a false premise: it's *not* necessarily an error.
> Isn't this almost exactly the same situation as we had in 9.0? > "PL/pgSQL now throws an error if a variable name conflicts with a > column name used in a query (Tom Lane)" No; the reason why the old behavior was problematic was precisely that it failed to conform to normal block-structured language design rules (namely that the most closely nested definition should win). If it had been like that to start with we'd probably have just left it that way. The complexity of behavior that you see there today is there to help people with debugging issues created by that change of behavior. While I don't necessarily have an objection to creating a way to help debug variable-name-shadowing issues, the idea that they're broken and we can just start throwing errors is *wrong*. The whole point of block structure in a language is that a block of code can be understood independently of what surrounds it. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers