Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UepGY-0006FA-Rd for pgsql-docs@arkaria.postgresql.org; Tue, 21 May 2013 16:18:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UepGY-0005Ac-C2 for pgsql-docs@arkaria.postgresql.org; Tue, 21 May 2013 16:18:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UepGX-0005AX-SC for pgsql-docs@postgresql.org; Tue, 21 May 2013 16:18:21 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UepGQ-0008Hh-Ig for pgsql-docs@postgresql.org; Tue, 21 May 2013 16:18:21 +0000 Received: from [192.168.1.110] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0LvPmd-1UVANa2wKp-010g78; Tue, 21 May 2013 18:18:14 +0200 Message-ID: <519B9E41.4080509@2ndQuadrant.com> Date: Tue, 21 May 2013 12:18:09 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-docs Subject: VALUES lists aliases Content-Type: multipart/mixed; boundary="------------030201030601020700020908" X-Provags-ID: V02:K0:hYbwN9caxqQCUN3pxt8/KwCGGVehU1fFt7L8EGkbH1D jZhlzaKUQTwX39HfyR17rwSO5rXQTwC6adtL+63hz4+J32wGdh J8l5g7b17eO6dvvRvA2bXkdyG1XQuGUHgdJ1p/9mAj2XFI9eBy D6HSX1IDRC28zXJY4jdVZLcZg8Xf4fApkFxDq/eanRYLozMRNq xe7ucfeVR8KI/uTgt38U5TuOKSnlVazuQQxX3nGunnEMYb1FBr Ns/RLtEMDhrPyDZoilO/i+oNwX97dc4B/zCUfQk/H3A4Q90XjO twWyd7qqfh2VOG3ytRhIHieKs6tUs1mmDo+EMS0eJG/sThE/3I X3TZG5/Ue/8ko0m3TNms= 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 This is a multi-part message in MIME format. --------------030201030601020700020908 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Next from the stream of doc comments, someone points out that if you read http://www.postgresql.org/docs/current/static/queries-values.html a beginner may not understand just what " table alias list" means. If you start at the beginning of the chapter it makes more sense, but it isn't necessarily obvious even then. Easiest fix is to demonstrate this by example, so that's what the attached patch adds. There was an example of this approach in the full documentation of VALUES already, but I felt that one was too complicated for a tutorial section. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com --------------030201030601020700020908 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="alias-list-example.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="alias-list-example.patch" diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml index d7b0d73..cf477c7 100644 --- a/doc/src/sgml/queries.sgml +++ b/doc/src/sgml/queries.sgml @@ -1609,7 +1609,16 @@ SELECT 3, 'three'; VALUES table. The column names are not specified by the SQL standard and different database systems do it differently, so it's usually better to override the default names with a table alias - list. + list: + +=> SELECT * FROM (VALUES (1, 'one'), (2, 'two'), (3, 'three')) AS t (num,letter); + num | letter +-----+-------- + 1 | one + 2 | two + 3 | three +(3 rows) + --------------030201030601020700020908 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs --------------030201030601020700020908--