[ for the archives' sake ]
David Johnston <polobo@yahoo.com> writes:
> Tom Lane-2 wrote
>> This is an intentional change that came in with the LATERAL feature.
>> The query is illegal per SQL spec but we used to allow it anyway,
>> on the theory that the table name "u" inside the aliased join "x"
>> wasn't visible anywhere that the other "u" was visible, so the
>> duplicate alias name was harmless. But in the presence of LATERAL
>> it's not harmless; consider
> While the behavior is intentional not mentioning it in the release notes,
> is an oversight that should be corrected.
The point that this is an incompatible change is a good one. I've
reconsidered and concluded it's better to remove the duplicate-alias
check; instead, we'll throw an error if there actually is an ambiguous
reference in a LATERAL subquery. This patch will appear in 9.3.2.
regards, tom lane