Re: Two columns with same name in subselect--any way to SELECTwithout *? - Mailing list pgsql-general

From David G. Johnston
Subject Re: Two columns with same name in subselect--any way to SELECTwithout *?
Date
Msg-id CAKFQuwbNzT7LXttDUWxK3md_hdLTiuPpAmYyrJu36ZwsRaghqQ@mail.gmail.com
Whole thread Raw
In response to Re: Two columns with same name in subselect--any way to SELECTwithout *?  (Ken Tanzer <ken.tanzer@gmail.com>)
List pgsql-general
On Saturday, January 6, 2018, Ken Tanzer <ken.tanzer@gmail.com> wrote:
So having thought about this a little more, it seems like once you create a result set with identically-named columns, those columns are effectively crippled.  In that they can be viewed (via SELECT *), but not referenced, used or acted upon in any way.  Still just wanting to confirm this is/is not the case.  Thanks!

I'm not really following the intent of the question but if your client API allows for column references by position instead of name you can still distinguish between them, too.

In subqueries or CREATE TABLE AS, no, the system, is going to force you to differentiate them since all SQL references are by name.

David J. 

pgsql-general by date:

Previous
From: Ken Tanzer
Date:
Subject: Re: Two columns with same name in subselect--any way to SELECTwithout *?
Next
From: pinker
Date:
Subject: Re: core system is getting unresponsive because over 300 cpu load