Re: Docs claim that "select myTable.*" wildcard won't let you assign column names

From: "Amir Rohan" <amir(dot)rohan(at)mail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Docs claim that "select myTable.*" wildcard won't let you assign column names
Date: 2015-09-22 19:40:58
Message-ID: trinity-e197b2d0-4ada-493c-a0a5-85e7784d9b1f-1442950858486@3capp-mailcom-lxa05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Monday, September 21, 2015, David G. Johnston wrote:

>To be honest, if you have a situation where you think you need to alias "*"
>you should probably be expanding that "*" out into individual column names
>anyway, which you can easily alias.
>

That depends. If my table has 30 columns and I just need to rename
the first couple, then I probably would find that advice unreasonable.

>The docs don't make a big deal of alising other than noting individually
>where they can happen (cte, from clause, select-list) and few questions
>that are raised are probably better served to be simply handled on these
>lists than cluttering the docs.

What constitutes "clutter", or what is "obvious", really depends on who is
making the assertion. A pg veteran's views probably don't mirrort those of the
person you'd typically find actually reading the docs, trying to figure out how
to write the query they want.

But yeah, the pg documentation isn't the best resource to pick up SQL from
(nor is is their purpose), and no patch I'd submit would really change that.
So, we're done.

Amir

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Amir Rohan 2015-09-26 09:02:06 Updated docs on base backups
Previous Message David G. Johnston 2015-09-22 01:58:58 Re: Docs claim that "select myTable.*" wildcard won't let you assign column names