Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TS8iX-0002oK-Oc for pgsql-docs@postgresql.org; Sat, 27 Oct 2012 15:54:33 +0000 Received: from smtp-vbr6.xs4all.nl ([194.109.24.26]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TS8iR-0003rV-SC for pgsql-docs@postgresql.org; Sat, 27 Oct 2012 15:54:32 +0000 Received: from webmail.xs4all.nl (dovemail18.xs4all.nl [194.109.26.20]) by smtp-vbr6.xs4all.nl (8.13.8/8.13.8) with ESMTP id q9RFsO75079084 for ; Sat, 27 Oct 2012 17:54:25 +0200 (CEST) (envelope-from er@xs4all.nl) Received: from 83.163.19.29 (SquirrelMail authenticated user er) by webmail.xs4all.nl with HTTP; Sat, 27 Oct 2012 17:54:25 +0200 Message-ID: Date: Sat, 27 Oct 2012 17:54:25 +0200 Subject: LATERAL synopsis From: "Erik Rijkers" To: pgsql-docs@postgresql.org User-Agent: SquirrelMail/1.4.18 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Pg-Spam-Score: 0.1 (/) X-Archive-Number: 201210/9 X-Sequence-Number: 7489 On the SELECT manual-page synopsis, http://www.postgresql.org/docs/devel/static/sql-select.html the LATERAL feature is documented in three sparate lines (the are separate, right?). Because of their length I was going to reformat them to let them fit in the .PDF page format, but looking a bit closer at that synopsis I have to admit I don't really understand it. Could someone please explain? [ LATERAL ] ( select ) [ AS ] alias [ ( column_alias [, ...] ) ] and: [ LATERAL ] function_name ( [ argument [, ...] ] ) [ AS ] alias [ ( column_alias [, ...] | column_definition [, ...] ) ] and: [ LATERAL ] function_name ( [ argument [, ...] ] ) AS ( column_definition [, ...] ) All three are listed as possible 'from_item's. But what does 'column_definition' stand for? (These are the only occurrences of 'column_definition' in the manual.) Are not the first two of the above LATERAL-lines sufficient? Or perhaps it would be even better to reduce it to only the first of those three lines (i.e. get rid of the 'function_name' lines)? Thanks, Erik Rijkers