Re: ambiguous column names in subqueries

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ambiguous column names in subqueries
Date: 2004-11-18 04:57:48
Message-ID: 87is834uur.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

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

That's really what I was asking I guess. Does the spec require the current
behaviour.

An alternative would be some way to explicitly remove columns from a result
set.

Something like

SELECT a+1 AS a, b+1 AS b, * EXCEPT (a,b)
FROM (SELECT 1 AS a, 2 as b, 3 as c)

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ruey-Lung Hsiao 2004-11-18 05:11:05 How to deal with order by, group by, distinct for user-defined types
Previous Message Neil Conway 2004-11-18 03:50:39 Re: Tired of -Wold-style-definition already