Re: ambiguous column names in subqueries - Mailing list pgsql-hackers

From Greg Stark
Subject Re: ambiguous column names in subqueries
Date
Msg-id 87is834uur.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: ambiguous column names in subqueries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.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



pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: Tired of -Wold-style-definition already
Next
From: Vsevolod Lobko
Date:
Subject: Re: are there any cons to linking libstdc++ with