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

From Oliver Jowett
Subject Re: ambiguous column names in subqueries
Date
Msg-id 419BC756.3020200@opencloud.com
Whole thread Raw
In response to ambiguous column names in subqueries  (Greg Stark <gsstark@mit.edu>)
Responses Re: ambiguous column names in subqueries
List pgsql-hackers
Greg Stark wrote:

> What purpose is there to returning both columns to the outer query? The
> columns become effectively inaccessible. There's no syntax for disambiguating
> any reference.
> 
> I think postgres should treat the second alias as hiding the first. Currently
> there's no way to selectively override a single output column. The only way to
> do is to put your query in a subquery and list every single output column
> again except the one you want to override.
> 
> Note that I'm not saying Postgres should remove ambiguous columns from
> different tables for the inner query. Only for subsequent layers where they
> have no way to access them anyways.

Please don't. JDBC (for example) has no problem with ambiguous columns, 
you just access them by index, and you have resultset metadata available 
if you want to implement your own rules for finding those indexes. It 
sounds like your problem really lies in the API you are using to access 
the results.

-O


pgsql-hackers by date:

Previous
From: John Hansen
Date:
Subject: split_part bug
Next
From: Alvaro Herrera
Date:
Subject: Re: Tired of -Wold-style-definition already