Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ze9iM-0001y7-Tp for pgsql-docs@arkaria.postgresql.org; Mon, 21 Sep 2015 22:37:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Ze9iM-0003hR-64 for pgsql-docs@arkaria.postgresql.org; Mon, 21 Sep 2015 22:37:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Ze9iL-0003gx-7c for pgsql-docs@postgresql.org; Mon, 21 Sep 2015 22:37:37 +0000 Received: from mout.gmx.com ([74.208.4.200]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.84) (envelope-from ) id 1Ze9iI-00060n-J1 for pgsql-docs@postgresql.org; Mon, 21 Sep 2015 22:37:35 +0000 Received: from [5.102.207.29] by 3capp-mailcom-lxa10.server.lan (via HTTP); Tue, 22 Sep 2015 00:37:33 +0200 MIME-Version: 1.0 Message-ID: From: "Amir Rohan" To: pgsql-docs@postgresql.org Subject: Docs claim that "select myTable.*" wildcard won't let you assign column names Content-Type: text/html; charset=UTF-8 Date: Tue, 22 Sep 2015 00:37:33 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K0:UVL9bs1QAm9F+P+2p9mQIywczfyEBpOBI1QDAXRSKKW dciDsUidkgx2w5oUYSBeC/YvPNN55hm0Q45VuCraUIgYtOHOD+ NGawmSuLh9n6Gv6Z4UDbtacHKwl8HanuNwIieHPqd/lR7Pgj59 Fhq0Cti9v0yxHlosZpE4/p9fErpl+UFnHlt7Vz6cZR6fAScrCv kVNg51LGpVPWamhzZtzI6Hc/Q0OnPZemDXqFXpZ9TTfa+ruLfv Rlil2W8yZBIad3yJAazAsqmBFdkdEyGZAHqhwqxOx9VMLSOt1O +IMs+s8HvKMFHzWL6rOAWZps8Ml X-UI-Out-Filterresults: notjunk:1;V01:K0:0Uj32fRebZw=:3un1JJsa1ZgHFVamke+rH7 Mkf+hSOUJJvNyt/8X0bwgJaAukaemjzyJlxcq8YCM7/5dTWJf78QxxkabEAApbAUZS0ndb9/j 0ppTreuOomdDmoZSLTX8gkKZFHEQ26LXbbCOMxiGyUxuZihmtSZXe2WS1bthOlJlfR+bJWGji xR9FW1hs92zDSLPvCEJRRibPasiNhx24lSFb49swJawVlTRj/ZvYJoHqfn8UYylbNQY6yxsc6 Mu3ICLVRwp+KNV+Vr7IR5YVwRrKu3OcU5BTz17IzeOvxzMWMnekBoo0YTsZCw1B8SbdlmbEOL JdiVEOqi9h22Nbthofzs63E2gKbXeh9BRXzkL0+0ywsQuAVc3aPZxSRs08foT0CLku4UN05q6 2qPMrf3nyuUX1VbTjji8wwlF+iKFqNeniT2m0hM16F9GWpb17IIyjiDfbHTbHei5aqpqVEjMY anW1uAqB1A== X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org
 
From http://www.postgresql.org/docs/9.4/static/sql-select.html (and previous version too):

  ##SELECT List

    <...>
    Instead of an expression, * can be written in the output list as a shorthand for all the columns of the selected rows.
    Also, you can write table_name.* as a shorthand for the columns coming from just that table. In these cases it is not
    possible to specify new names with AS; the output column names will be the same as the table columns' names.
 
But, the docs elsewhere feature a query example show the use of a wildcard for columns
as well as allowing you to assign names to as many of the leading columns as you wish:
 
WITH T0 as ( SELECT 1,2,3 )
SELECT T0.* from T0 as T0(foo,bar) ;
 
 foo │ bar │ ?column?
─────┼─────┼──────────
   1 │   2 │        3
(1 row)
 
The following curious variant also works:
 
WITH T0 as ( SELECT 1,2,3 )
SELECT justAnythingReally.* from T0 as justAnythingReally(foo,bar) ;
 
The synoposis/grammer at the top doesn't hint at this either. I've checked and this has been supported since at least 9.2 .
 
Regards,
Amir