11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.119 2009/01/23 14:05:28 momjian Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.120 2009/02/02 20:42:57 tgl Exp $
33PostgreSQL documentation
44-->
55
@@ -1002,6 +1002,13 @@ OFFSET <replaceable class="parameter">start</replaceable>
10021002 class="parameter">count</replaceable> rows to be returned.
10031003 </para>
10041004
1005+ <para>
1006+ If the <replaceable class="parameter">count</replaceable> expression
1007+ evaluates to NULL, it is treated as <literal>LIMIT ALL</>, i.e., no
1008+ limit. If <replaceable class="parameter">start</replaceable> evaluates
1009+ to NULL, it is treated the same as <literal>OFFSET 0</>.
1010+ </para>
1011+
10051012 <para>
10061013 SQL:2008 introduced a different syntax to achieve the same thing,
10071014 which PostgreSQL also supports. It is:
@@ -1014,10 +1021,11 @@ FETCH { FIRST | NEXT } [ <replaceable class="parameter">count</replaceable> ] {
10141021 the <literal>FETCH</literal> clause. <literal>ROW</literal>
10151022 and <literal>ROWS</literal> as well as <literal>FIRST</literal>
10161023 and <literal>NEXT</literal> are noise words that don't influence
1017- the effects of these clauses. When using expressions other than
1018- constants for the offset or fetch count, parentheses will be
1019- necessary in most cases. If the fetch count is omitted, it
1020- defaults to 1.
1024+ the effects of these clauses. In this syntax, when using expressions
1025+ other than simple constants for <replaceable class="parameter">start</>
1026+ or <replaceable class="parameter">count</replaceable>, parentheses will be
1027+ necessary in most cases. If <replaceable class="parameter">count</> is
1028+ omitted in <literal>FETCH</>, it defaults to 1.
10211029 </para>
10221030
10231031 <para>