Re: ambiguous column names in subqueries

From: Oliver Jowett <oliver(at)opencloud(dot)com>
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 21:49:10
Message-ID: 419BC756.3020200@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-11-17 21:58:27 Re: [HACKERS] split_part bug
Previous Message Alvaro Herrera 2004-11-17 21:48:20 Re: Tired of -Wold-style-definition already