postgres.git / summary / log / commit / refs
commit da1eacb8d2cebc5b43bbe2c93f1c74c962182ae5
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thu Dec 01 21:39:07 2011 +0000
First released in: 9.2.0, 9.0.6, 9.1.2
Clarify documentation about SQL:2008 variant of LIMIT/OFFSET syntax.
The point that you need parentheses for non-constant expressions apparently
needs to be brought out a bit more clearly, per bug #6315.
doc/src/sgml/ref/select.sgml | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml
index 15d9b75b59b..3fbfda309e2 100644
--- a/doc/src/sgml/ref/select.sgml
+++ b/doc/src/sgml/ref/select.sgml
@@ -1056,17 +1056,19 @@ OFFSET <replaceable class="parameter">start</replaceable>
OFFSET <replaceable class="parameter">start</replaceable> { ROW | ROWS }
FETCH { FIRST | NEXT } [ <replaceable class="parameter">count</replaceable> ] { ROW | ROWS } ONLY
</synopsis>
- According to the standard, the <literal>OFFSET</literal> clause must come
- before the <literal>FETCH</literal> clause if both are present; but
- <productname>PostgreSQL</> is laxer and allows either order.
+ In this syntax, to write anything except a simple integer constant for
+ <replaceable class="parameter">start</> or <replaceable
+ class="parameter">count</replaceable>, you must write parentheses
+ around it.
+ If <replaceable class="parameter">count</> is
+ omitted in a <literal>FETCH</> clause, it defaults to 1.
<literal>ROW</literal>
and <literal>ROWS</literal> as well as <literal>FIRST</literal>
and <literal>NEXT</literal> are noise words that don't influence
- the effects of these clauses. In this syntax, when using expressions
- other than simple constants for <replaceable class="parameter">start</>
- or <replaceable class="parameter">count</replaceable>, parentheses will be
- necessary in most cases. If <replaceable class="parameter">count</> is
- omitted in <literal>FETCH</>, it defaults to 1.
+ the effects of these clauses.
+ According to the standard, the <literal>OFFSET</literal> clause must come
+ before the <literal>FETCH</literal> clause if both are present; but
+ <productname>PostgreSQL</> is laxer and allows either order.
</para>
<para>
[parent: 698bb4ec4f3f]