Re: Re: BUG #8444: ERROR: table name "tblb" specified more than once in subquery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Re: BUG #8444: ERROR: table name "tblb" specified more than once in subquery
Date: 2013-11-11 16:12:16
Message-ID: 32617.1384186336@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

[ for the archives' sake ]

David Johnston <polobo(at)yahoo(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message stephane.wustner 2013-11-11 17:19:56 BUG #8587: quantile segfaults when quantile out of [0;1] range
Previous Message Erik de Castro Lopo 2013-11-11 04:36:54 Re: BUG #8586: Misleading fe_sendauth error message