public inbox for [email protected]  
help / color / mirror / Atom feed
LATERAL synopsis
3+ messages / 2 participants
[nested] [flat]

* LATERAL synopsis
@ 2012-10-27 15:54  Erik Rijkers <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Erik Rijkers @ 2012-10-27 15:54 UTC (permalink / raw)
  To: pgsql-docs

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: LATERAL synopsis
@ 2012-10-27 16:44  Tom Lane <[email protected]>
  parent: Erik Rijkers <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2012-10-27 16:44 UTC (permalink / raw)
  To: Erik Rijkers <[email protected]>; +Cc: pgsql-docs

"Erik Rijkers" <[email protected]> writes:
> [ LATERAL ] function_name ( [ argument [, ...] ] ) AS ( column_definition [, ...] )

> But what does 'column_definition' stand for?  (These are the only occurrences of
> 'column_definition' in the manual.)

This is the syntax for specifying what columns a
function-returning-RECORD is actually going to return.  I'm too lazy to
chase down the reference and see whether it's really inconsistent or
not --- but that line was like that before I added [ LATERAL ] to it ...

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: LATERAL synopsis (patch to wrap long line)
@ 2012-10-27 17:55  Erik Rijkers <[email protected]>
  parent: Tom Lane <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Erik Rijkers @ 2012-10-27 17:55 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: pgsql-docs

On Sat, October 27, 2012 18:44, Tom Lane wrote:
> "Erik Rijkers" <[email protected]> writes:
>> [ LATERAL ] function_name ( [ argument [, ...] ] ) AS ( column_definition [, ...] )
>
>> But what does 'column_definition' stand for?  (These are the only occurrences of
>> 'column_definition' in the manual.)
>
> This is the syntax for specifying what columns a
> function-returning-RECORD is actually going to return.  I'm too lazy to
> chase down the reference and see whether it's really inconsistent or
> not --- but that line was like that before I added [ LATERAL ] to it ...
>

OK. I see it goes back to 7.3.  It's probably not a problem.


I returned to the initial reason that I looked at the select.sgml, namely the truncation of some
of the synopsis-lines in the .pdf page for select.sgml.

Attached patch wraps the worst-longest line so that if becomes visible in pdf.  It makes the .html
version slightly less pretty, but I hope the .pdf readability (integrity, even) counts for
something too.

(the remaining long lines in select.sgml page are cut off (for pdf) in the middle of some last
element and as such are still  readable / clear enough.)

If changes like these (where the .html suffers slightly for .pdf integrity) are acceptable, I
would like to make some more doc-patches where the .pdf is rendered readable (almost always the
synopsis, but maybe there are still some code examples).


Thanks,

Erik Rijkers





Attachments:

  [application/octet-stream] select.sgml.diff (2.0K, 2-select.sgml.diff)
  download | inline diff:
--- doc/src/sgml/ref/select.sgml.orig	2012-10-27 11:40:52.695778875 +0200
+++ doc/src/sgml/ref/select.sgml	2012-10-27 19:17:50.242805595 +0200
@@ -52,7 +52,8 @@
     [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [ [ AS ] <replaceable class="parameter">alias</replaceable> [ ( <replaceable class="parameter">column_alias</replaceable> [, ...] ) ] ]
     [ LATERAL ] ( <replaceable class="parameter">select</replaceable> ) [ AS ] <replaceable class="parameter">alias</replaceable> [ ( <replaceable class="parameter">column_alias</replaceable> [, ...] ) ]
     <replaceable class="parameter">with_query_name</replaceable> [ [ AS ] <replaceable class="parameter">alias</replaceable> [ ( <replaceable class="parameter">column_alias</replaceable> [, ...] ) ] ]
-    [ LATERAL ] <replaceable class="parameter">function_name</replaceable> ( [ <replaceable class="parameter">argument</replaceable> [, ...] ] ) [ AS ] <replaceable class="parameter">alias</replaceable> [ ( <replaceable class="parameter">column_alias</replaceable> [, ...] | <replaceable class="parameter">column_definition</replaceable> [, ...] ) ]
+    [ LATERAL ] <replaceable class="parameter">function_name</replaceable> ( [ <replaceable class="parameter">argument</replaceable> [, ...] ] )
+         [ AS ] <replaceable class="parameter">alias</replaceable> [ ( <replaceable class="parameter">column_alias</replaceable> [, ...] | <replaceable class="parameter">column_definition</replaceable> [, ...] ) ]
     [ LATERAL ] <replaceable class="parameter">function_name</replaceable> ( [ <replaceable class="parameter">argument</replaceable> [, ...] ] ) AS ( <replaceable class="parameter">column_definition</replaceable> [, ...] )
     <replaceable class="parameter">from_item</replaceable> [ NATURAL ] <replaceable class="parameter">join_type</replaceable> <replaceable class="parameter">from_item</replaceable> [ ON <replaceable class="parameter">join_condition</replaceable> | USING ( <replaceable class="parameter">join_column</replaceable> [, ...] ) ]
 


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2012-10-27 17:55 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-10-27 15:54 LATERAL synopsis Erik Rijkers <[email protected]>
2012-10-27 16:44 ` Tom Lane <[email protected]>
2012-10-27 17:55   ` Re: LATERAL synopsis (patch to wrap long line) Erik Rijkers <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox