Re: ambiguous column names in subqueries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ambiguous column names in subqueries
Date: 2004-11-17 22:23:05
Message-ID: 4701.1100730185@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> select * from (select 1 as foo, 2 as foo) as x(foo1, foo2);

> I still have the maintenance problem of having to edit the outer query every
> time the list of columns from the inner query changes.

Yeah, but at least you only have to do it in one place.

AFAICS removing columns from the inner query because they have duplicate
names would violate the SQL spec, so it's not going to happen.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-11-17 22:27:41 Re: [HACKERS] split_part bug
Previous Message Greg Stark 2004-11-17 22:13:04 Re: ambiguous column names in subqueries